API

Class DataReader

Utility class for reading from a data buffer

Index
buffer: IDataBuffer

The data buffer associated with this data reader.

byteOffset: number = 0

The current byte offset from the beginning of the data buffer.

  • Loads the given byte length.

    Parameters

    • byteLength: number

      The byte length to load

    Returns Promise<void>

    A promise that resolves when the load is complete

  • Read a string from the currently loaded data range.

    Parameters

    • byteLength: number

      The byte length to read

    Returns string

    The string read

  • Read a byte array from the currently loaded data range.

    Parameters

    • byteLength: number

      The byte length to read

    Returns Uint8Array

    The byte array read

  • Skips the given byte length the currently loaded data range.

    Parameters

    • byteLength: number

      The byte length to skip

    Returns void