@chickenjdk/byteutils
    Preparing search index...

    Class DynamicBuffer

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    length: number = Infinity
    supportsDynamicChunkSize: boolean = false

    Accessors

    • get allocatedLength(): number

      Returns number

    • get chunkSize(): number

      Returns number

    • set chunkSize(size: number): void

      Parameters

      • size: number

      Returns void

    Methods

    • Get a copy of the data in the buffer between two indexes. (same behavior as .slice in a Uint8Array)

      Parameters

      • indexStart: number
      • indexEnd: number

      Returns Uint8Array<ArrayBufferLike>

    • Get an array of subarrays of the internal buffers! (WARNING: mutations will edit the data in this instance) Like .get, but does not join the chunks. Also does not give you more data than we really have, making the "infinite length buffer" abstraction leaky but allocatedLength does that too.

      Parameters

      • indexStart: number

        The starting index (inclusive)

      • indexEnd: number

        The ending index (exclusive)

      Returns Uint8Array<ArrayBufferLike>[]

      Your buffers, fresh off .subarray

    • Set byte(s) in a position in the buffer

      Parameters

      • value: number | ArrayLike<number> | Uint8Array<ArrayBufferLike>

        The byte(s)

      • indexStart: number

        The starting index, or if you only provide one byte, the index, of where the data should go

      Returns void