@backblaze-labs/b2-sdk - v0.1.0
    Preparing search index...

    Class BufferSource

    ContentSource backed by a Uint8Array buffer.

    Implements

    Index

    Constructors

    Properties

    Methods

    Constructors

    • Create a BufferSource wrapping the given Uint8Array.

      Parameters

      • buffer: Uint8Array

        The byte buffer to use as the underlying content.

      Returns BufferSource

    Properties

    canSlice: true

    Random-access: the entire payload lives in memory.

    size: number

    Methods

    • Return a new BufferSource covering the specified byte range.

      Parameters

      • start: number

        The zero-based byte offset to begin the slice.

      • end: number

        The exclusive byte offset where the slice ends.

      Returns ContentSource

      A new ContentSource representing the requested sub-range.

    • Open the buffer content as a ReadableStream.

      Returns ReadableStream<Uint8Array<ArrayBufferLike>>

      A ReadableStream that emits the buffer bytes in a single chunk.

    • Read the entire buffer content into an ArrayBuffer.

      Returns Promise<ArrayBuffer>

      A promise that resolves with the full content as an ArrayBuffer.