Class BitReader

Class for reading bit strings

Constructors

Properties

_bits: BitString
_checkpoints: number[] = []
_offset: number

Accessors

Methods

  • Parameters

    • bytes: number
    • offset: number

    Returns Buffer

  • Preload int from specific offset

    Parameters

    • bits: number

      bits to preload

    • offset: number

      offset to start from

    Returns bigint

    read value as bigint

  • Preload uint from specific offset

    Parameters

    • bits: number

      bits to preload

    • offset: number

      offset to start from

    Returns bigint

    read value as bigint

  • Load a single bit

    Returns boolean

    true if the bit is set, false otherwise

  • Load buffer

    Parameters

    • bytes: number

      number of bytes

    Returns Buffer

    new buffer

  • Load int value

    Parameters

    • bits: number

      int bits

    Returns number

    read value as bigint

  • Load int value as bigint

    Parameters

    • bits: number

      int bits

    Returns bigint

    read value as bigint

  • Load uint value

    Parameters

    • bits: number

      uint bits

    Returns number

    read value as number

  • Load uint value as bigint

    Parameters

    • bits: number

      uint bits

    Returns bigint

    read value as bigint

  • Load varint value

    Parameters

    • bits: number

      number of bits to read the size

    Returns number

    read value as bigint

  • Load varint value

    Parameters

    • bits: number

      number of bits to read the size

    Returns bigint

    read value as bigint

  • Load varuint value

    Parameters

    • bits: number

      number of bits to read the size

    Returns number

    read value as bigint

  • Load varuint value

    Parameters

    • bits: number

      number of bits to read the size

    Returns bigint

    read value as bigint

  • Preload bit

    Returns boolean

    true if the bit is set, false otherwise

  • Preload buffer

    Parameters

    • bytes: number

      number of bytes

    Returns Buffer

    new buffer

  • Preload int value

    Parameters

    • bits: number

      int bits

    Returns number

    read value as bigint

  • Preload int value

    Parameters

    • bits: number

      int bits

    Returns bigint

    read value as bigint

  • Preload uint value

    Parameters

    • bits: number

      uint bits

    Returns number

    read value as number

  • Preload uint value as bigint

    Parameters

    • bits: number

      uint bits

    Returns bigint

    read value as bigint

  • Preload varint value

    Parameters

    • bits: number

      number of bits to read the size

    Returns number

    read value as bigint

  • Preload varint value

    Parameters

    • bits: number

      number of bits to read the size

    Returns bigint

    read value as bigint

  • Preload varuint value

    Parameters

    • bits: number

      number of bits to read the size

    Returns number

    read value as bigint

  • Preload varuint value

    Parameters

    • bits: number

      number of bits to read the size

    Returns bigint

    read value as bigint

  • Skip bits

    Parameters

    • bits: number

      number of bits to skip

    Returns void