Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DataReader

Utility class for reading from a data buffer

Hierarchy

  • DataReader

Index

Constructors

constructor

  • Constructor

    Parameters

    Returns DataReader

Properties

Readonly bufferSearch playground for buffer

buffer: IDataBuffer

The data buffer associated with this data reader.

byteOffsetSearch playground for byteOffset

byteOffset: number

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

Methods

loadAsyncSearch playground for loadAsync

  • loadAsync(byteLength: number): Promise<void>
  • 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

readStringSearch playground for readString

  • readString(byteLength: number): string
  • Read a string from the currently loaded data range.

    Parameters

    • byteLength: number

      The byte length to read

    Returns string

    The string read

readUint32Search playground for readUint32

  • readUint32(): number
  • Read a unsigned 32-bit integer from the currently loaded data range.

    Returns number

    The 32-bit integer read

readUint8ArraySearch playground for readUint8Array

  • readUint8Array(byteLength: number): Uint8Array
  • Read a byte array from the currently loaded data range.

    Parameters

    • byteLength: number

      The byte length to read

    Returns Uint8Array

    The byte array read

skipBytesSearch playground for skipBytes

  • skipBytes(byteLength: number): void
  • Skips the given byte length the currently loaded data range.

    Parameters

    • byteLength: number

      The byte length to skip

    Returns void

Legend

  • Constructor
  • Property
  • Method
  • Property
  • Method
  • Inherited property
  • Inherited method
  • Static property
  • Static method