"Sputnik" help  
Sputnik Help
BinaryWriteInt64(<binary>, <position>, <value>, [<endian>])

Description

Writes a int64 value to a binary array at the specified position.

Parameters

<binary> The binary array to write to.
<position> The position in the binary array to write to.
<value> The value to be written.
<endian> Optional endianness of the write. (Default: @EndianNative)

Return Value

Success: Returns true if the value was written successfully.
Failure: Returns null if the position is out of bounds or an error occurs during writing.

Remarks

The BinaryWriteInt64 function writes a single int64 value to the binary array at the specified position. The optional <endian> parameter allows you to specify the endianness of the value when written. By default, it uses the machine-specific endianness, which can be accessed using the @EndianNative constant.

Related

BinaryReadInt64

Example

Example of usage:

my $a = BinNew(32);

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

say BinaryExpand($a, false);

say BinaryReadInt64($a, 0);
say BinaryReadInt64($a, 8);
say BinaryReadInt64($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