@chickenjdk/byteutils
    Preparing search index...

    Class ChunkTransformerEmitter

    Hierarchy (View Summary)

    Index

    Constructors

    • Take a non-uniform-size stream of Uint8Arrays, and join them together into uniform size Uint8Arrays. Emits the chunks as they are completely filled, or when .flush is called (Emits what is currently filled)

      Parameters

      • OptionalchunkSize: number = 2000

        The size of a chunk. May be changed later.

      Returns ChunkTransformerEmitter

    Properties

    resizingIsImmediate: boolean = true

    Accessors

    • get _buffered(): Uint8Array<ArrayBufferLike>

      Get the currently buffered data. Useful for custom logic

      Returns Uint8Array<ArrayBufferLike>

    • get chunkSize(): number

      The size of the buffer. NOT the size that we are allocating for new chunks.

      Returns number

    • get length(): number

      Returns number

    • get newChunkSize(): number

      The size that the newly allocated buffers should be. Set with .resize

      Returns number

    Methods

    • Flush the currently buffered data to the output. Replaced by .flushUsed

      Returns void

    • Change the chunk size of the buffer

      Parameters

      • chunkSize: number

        The chunk size

      Returns void | undefined

    • Write a Uint8Array or array

      Parameters

      • data: number[] | Uint8Array<ArrayBufferLike>

        The data to write

      Returns void