@chickenjdk/byteutils
    Preparing search index...

    Hierarchy (View Summary)

    Index

    Constructors

    • Take a bunch of individual Uint8Arrays and read/edit them as a single whole buffer. Also allocated new Uint8Arrays if you go out of the bounds of the ones you pass. This is meant as temporary! This is slow for long-term use!

      Parameters

      • buffers: Uint8Array<ArrayBufferLike>[]
      • newAllocatedChunkSize: number = 2000

      Returns ShardBuffer

    Properties

    length: number = Infinity
    supportsDynamicChunkSize: boolean = true

    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