Endo API documentation
    Preparing search index...

    Represents a raw buffer of binary data, which is used to store data for the different typed arrays. ArrayBuffers cannot be read from or written to directly, but can be passed to a typed array or DataView Object to interpret the raw buffer as needed.

    interface ArrayBuffer {
        "[toStringTag]": "ArrayBuffer";
        byteLength: number;
        immutable: boolean;
        sliceToImmutable: (start?: number, end?: number) => ArrayBuffer;
        transferToImmutable: (newLength?: number) => ArrayBuffer;
        get detached(): boolean;
        get maxByteLength(): number;
        get resizable(): boolean;
        resize(newByteLength?: number): void;
        slice(begin?: number, end?: number): ArrayBuffer;
        transfer(newByteLength?: number): ArrayBuffer;
        transferToFixedLength(newByteLength?: number): ArrayBuffer;
    }
    Index

    Properties

    "[toStringTag]": "ArrayBuffer"
    byteLength: number

    Read-only. The length of the ArrayBuffer (in bytes).

    immutable: boolean

    Whether the buffer is immutable.

    sliceToImmutable: (start?: number, end?: number) => ArrayBuffer

    Creates an immutable slice of the given buffer.

    Type declaration

      • (start?: number, end?: number): ArrayBuffer
      • Parameters

        • Optionalstart: number

          The start index.

        • Optionalend: number

          The end index.

        Returns ArrayBuffer

        The sliced immutable ArrayBuffer.

    transferToImmutable: (newLength?: number) => ArrayBuffer

    Transfer the contents to a new immutable ArrayBuffer

    Type declaration

      • (newLength?: number): ArrayBuffer
      • Parameters

        • OptionalnewLength: number

          The start index.

        Returns ArrayBuffer

        The new immutable ArrayBuffer.

    Accessors

    • get detached(): boolean

      Returns a boolean indicating whether or not this buffer has been detached (transferred).

      MDN

      Returns boolean

    • get maxByteLength(): number

      If this ArrayBuffer is resizable, returns the maximum byte length given during construction; returns the byte length if not.

      MDN

      Returns number

    • get resizable(): boolean

      Returns true if this ArrayBuffer can be resized.

      MDN

      Returns boolean

    Methods

    • Resizes the ArrayBuffer to the specified size (in bytes).

      MDN

      Parameters

      • OptionalnewByteLength: number

      Returns void

    • Returns a section of an ArrayBuffer.

      Parameters

      • Optionalbegin: number
      • Optionalend: number

      Returns ArrayBuffer

    • Creates a new ArrayBuffer with the same byte content as this buffer, then detaches this buffer.

      MDN

      Parameters

      • OptionalnewByteLength: number

      Returns ArrayBuffer

    • Creates a new non-resizable ArrayBuffer with the same byte content as this buffer, then detaches this buffer.

      MDN

      Parameters

      • OptionalnewByteLength: number

      Returns ArrayBuffer