"Sputnik" help  
Sputnik Help
BinaryReadUInt64(<binary>, <position>, <endian>)

Description

Reads a uint64 from a binary array at the specified position.

Parameters

<binary> The binary array from which will be read.
<position> The position in the binary array to read from.
<endian> Optional endianness of the read. (Default: @EndianNative)

Return Value

Success: Returns the value read from the binary array.
Failure: Returns null if the position is out of bounds or an error occurs during reading.

Remarks

The BinaryReadUInt64 function reads a single uint64 from the binary array at the specified position. The optional <endian> parameter allows you to specify the endianness of the value read. By default, it uses the machine-specific endianness, which can be accessed using the @EndianNative constant.

Related

BinaryWriteUInt64

Example

Example of usage:

my $a = BinNew(32);

BinaryWriteUInt64($a, 0, 12);
BinaryWriteUInt64($a, 8, 0x20);
BinaryWriteUInt64($a, 16, 'a');

say BinaryExpand($a, false);

say BinaryReadUInt64($a, 0);
say BinaryReadUInt64($a, 8);
say BinaryReadUInt64($a, 16);

// PRINTS
// 0C 00 00 00 00 00 00 00 20 00 00 00 00 00 00 00 ........ .......
// 61 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 a...............
// 12
// 32
// 97

 


Contact
Cheryl (uberfox@hotmail.com)
Homepage
http://ubersoft.org