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

    Class StreamSource

    ContentSource backed by a ReadableStream. Can only be consumed once and does not support slicing.

    Implements

    Index

    Constructors

    Properties

    Methods

    Constructors

    • Create a StreamSource wrapping the given ReadableStream with a known byte size.

      Parameters

      • readable: ReadableStream<Uint8Array<ArrayBufferLike>>

        The ReadableStream to wrap as a content source.

      • size: number

        The total number of bytes the stream will produce.

      Returns StreamSource

    Properties

    canSlice: false

    Forward-only: ReadableStreams cannot be repositioned, so multipart uploads must take the sequential path. See the interface comment on canSlice for what the engine does with this flag.

    size: number

    Methods

    • Open the underlying ReadableStream. Can only be called once.

      Returns ReadableStream<Uint8Array<ArrayBufferLike>>

      The underlying ReadableStream of bytes.

      If the stream has already been consumed.

    • Read the entire stream into an ArrayBuffer.

      Returns Promise<ArrayBuffer>

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