[bytes->import16Bits] appends the low 16 bits (2 bytes) of an integer onto the end of the byte stream. The integer parameter is converted into an unsigned short and then imported.
bytes->import16Bits(32000)
This example imports an integer into a bytes object and prints the value as hexadecimal.
Code
bytes->import16Bits(32101) & encodeHex
Result
657D
The integer's bytes are imported using the endianess of the host machine. Look at [integer->hostToNet16] and [integer->netToHost16] to perform byte swapping.
Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft
Recent Comments