love.data
Provides functionality for creating and transforming data. </b>
Functions
Name | Description |
---|---|
newByteData | Creates a new ByteData object by copying the contents of the specified string or existing ByteData object |
compress | Compresses a string or data using a specific compression algorithm |
decompress | Decompresses a CompressedData or previously compressed string or Data object |
decode | Decode Data or a string from any of the EncodeFormats to Data or string |
encode | Encode Data or a string to a Data or string in one of the EncodeFormats |
hash | Compute the message digest of a string using a specified hash algorithm |
newDataView | Creates a new Data referencing a subsection of an existing Data object |
pack | Packs (serializes) simple Lua values. This function behaves the same as Lua 5.3’s string.pack |
unpack | Unpacks (deserializes) a byte-string or Data into simple Lua values. This function behaves the same as Lua 5.3’s string.unpack |
getPackedSize | Gets the size in bytes that a given format used with love.data.pack will use. This function behaves the same as Lua 5.3’s string.packsize |
Types
Data
The superclass of all data. Cannot be instantiated normally.
Name | Description |
---|---|
clone | Creates and returns a new copy of the Data object |
getPointer | Gets a pointer to the Data |
getSize | Gets the Data’s size in bytes |
getString | Gets the full Data as a string |
These functions are also the same for ByteData and DataView objects. </b>
See also: