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);

Constructors

Accessors

Methods

  • Reads a 64-bit unsigned integer in big-endian format and advances the offset.

    Returns bigint

    The read 64-bit unsigned integer

  • Reads specified number of bytes and advances the offset.

    Parameters

    • length: number

      Number of bytes to read

    Returns Uint8Array<ArrayBufferLike>

    Array containing the read bytes

  • Reads a 32-bit integer in big-endian format and advances the offset.

    Returns number

    The read 32-bit integer