Class ArrayBufferSink

Fast incremental writer that becomes an ArrayBuffer on end().

Hierarchy

  • ArrayBufferSink

Constructors

Methods

Constructors

Methods

  • Returns Uint8Array | ArrayBuffer

  • Flush the internal buffer

    If start was passed a stream option, this will return a ArrayBuffer If start was passed a stream option and asUint8Array, this will return a Uint8Array Otherwise, this will return the number of bytes written since the last flush

    This API might change later to separate Uint8ArraySink and ArrayBufferSink

    Returns number | Uint8Array | ArrayBuffer

  • Parameters

    • Optional options: { asUint8Array?: boolean; highWaterMark?: number; stream?: boolean }
      • Optional asUint8Array?: boolean
      • Optional highWaterMark?: number

        Preallocate an internal buffer of this size This can significantly improve performance when the chunk size is small

      • Optional stream?: boolean

        On flush, return the written data as a Uint8Array. Writes will restart from the beginning of the buffer.

    Returns void

  • Parameters

    • chunk: string | ArrayBuffer | ArrayBufferView

    Returns number

Generated using TypeDoc