A utility class for reading binary data sequentially from an ArrayBuffer. Provides methods to read different data types in big-endian format.
const reader = new BinaryReader(arrayBuffer);const int32 = reader.readInt32BE();const bigInt = reader.readBigUInt64BE();const bytes = reader.readBytes(4); Copy
const reader = new BinaryReader(arrayBuffer);const int32 = reader.readInt32BE();const bigInt = reader.readBigUInt64BE();const bytes = reader.readBytes(4);
Creates a new BinaryReader instance.
The buffer to read from
Gets current position in the buffer.
Current offset in bytes
Reads a 64-bit unsigned integer in big-endian format and advances the offset.
The read 64-bit unsigned integer
Reads specified number of bytes and advances the offset.
Number of bytes to read
Array containing the read bytes
Reads a 32-bit integer in big-endian format and advances the offset.
The read 32-bit integer
A utility class for reading binary data sequentially from an ArrayBuffer. Provides methods to read different data types in big-endian format.
Example