Hierarchy

  • Writable
    • Reader

Constructors

  • Creates a new instance of the reader

    Parameters

    • blob: string | Uint8Array | Buffer | Writer | Reader = ...
    • encoding: BufferEncoding = 'hex'

    Returns Reader

Accessors

  • get buffer(): Buffer
  • Returns the current contents of the buffer

    Returns Buffer

  • get length(): number
  • Returns the byte size of the current buffer

    Returns number

  • get offset(): number
  • Returns the current read offset of the buffer

    Returns number

  • get unreadBuffer(): Buffer
  • Returns the unread portion of the buffer

    Returns Buffer

  • get unreadBytes(): number
  • Returns the number of unread bytes left in the buffer

    Returns number

Methods

  • Appends the supplied value to the end of the buffer

    Parameters

    • blob: string | Uint8Array | Buffer | Writer | Reader
    • encoding: BufferEncoding = 'hex'

    Returns void

  • Read the specified number of bytes from the buffer

    Parameters

    • count: number = 1

    Returns Buffer

  • Compacts the current buffer by truncating up to the unread position of the buffer

    Parameters

    • offset: number = ...

    Returns void

  • Reads a hash from the buffer

    Parameters

    • size: number = 32
    • encoding: BufferEncoding = 'hex'

    Returns string

  • Reads the specified number of hex encoded bytes from the buffer

    Parameters

    • count: number = 1
    • encoding: BufferEncoding = 'hex'

    Returns string

  • Reads an int16_t from the buffer

    Parameters

    • bigEndian: boolean = false

    Returns BigInteger

  • Reads an int32_t from the buffer

    Parameters

    • bigEndian: boolean = false

    Returns BigInteger

  • Reads an int64_t from the buffer

    Parameters

    • bigEndian: boolean = false

    Returns BigInteger

  • Reads an int8_t from the buffer

    Returns BigInteger

  • Resets the current position of the buffer back to the beginning

    Parameters

    • offset: number = 0

    Returns void

  • Reads a signed integer from the buffer

    Parameters

    • bits: number
    • bigEndian: boolean = false

    Returns BigInteger

  • Skips reading the specified number of bytes from the buffer

    Parameters

    • count: number = 1

    Returns void

  • Reads a string from the buffer

    Parameters

    • encoding: BufferEncoding = 'utf-8'

    Returns string

  • Reads a time_t from the buffer

    Parameters

    • bigEndian: boolean = false

    Returns Date

  • Returns the current contents of the buffer as a string

    Parameters

    • encoding: BufferEncoding = 'hex'

    Returns string

  • Reads an uint128_t from the buffer

    Parameters

    • bigEndian: boolean = false

    Returns BigInteger

  • Reads an uint16_t from the buffer

    Parameters

    • bigEndian: boolean = false

    Returns BigInteger

  • Reads an uint256_t from the buffer

    Parameters

    • bigEndian: boolean = false

    Returns BigInteger

  • Reads an uint32_t from the buffer

    Parameters

    • bigEndian: boolean = false

    Returns BigInteger

  • Reads an uint512_t from the buffer

    Parameters

    • bigEndian: boolean = false

    Returns BigInteger

  • Reads an uint64_t from the buffer

    Parameters

    • bigEndian: boolean = false

    Returns BigInteger

  • Reads an uint8_t from the buffer

    Returns BigInteger

  • Reads an unsigned integer from the buffer

    Parameters

    • bits: number
    • bigEndian: boolean = false

    Returns BigInteger

  • Reads a Varint from the buffer

    Parameters

    • peek: boolean = false
    • levin: boolean = false

    Returns BigInteger