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

    Class BlobSource

    ContentSource backed by a Blob or File.

    Implements

    Index

    Constructors

    Properties

    Methods

    Constructors

    • Create a BlobSource wrapping the given Blob.

      Parameters

      • blob: Blob

        The Blob or File to use as the underlying content.

      Returns BlobSource

    Properties

    canSlice: true

    Random-access: Blob.slice() is cheap and returns a new Blob view.

    size: number

    Methods

    • Return a new BlobSource 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 Blob content as a ReadableStream.

      Returns ReadableStream<Uint8Array<ArrayBufferLike>>

      A ReadableStream of the Blob bytes.

    • Read the entire Blob content into an ArrayBuffer.

      Returns Promise<ArrayBuffer>

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