Colibrio Reader Framework API - Cloud license
    Preparing search index...

    Class ReadableStreamResourceResponse

    A ResourceResponse that uses a ReadableStream as the underlying data source.

    Implements

    Constructors

    • Creates new instance.

      Parameters

      • _metadata: IResourceMetadata

        The resource metadata.

      • _readableStream: ReadableStream<Uint8Array<ArrayBufferLike>>

        The ReadableStream containing the body data.

      • Optional_abortCallback: () => void

        An optional callback that should abort the ReadableStream by enqueuing an ColibrioError with errorType set to ColibrioErrorType.ABORTED, or a DOMException with name set to "AbortError". If the ReadableStream has been retrieved from a fetch() response, an AbortController should be used to abort the ReadableStream. See: https://developer.mozilla.org/en-US/docs/Web/API/AbortController

      Returns ReadableStreamResourceResponse

    Methods

    • Abort any ongoing read operation with a ColibrioError with errorType set to ColibrioErrorType.ABORTED.

      Returns void

    • Fetch the response body as text.

      The supported text encodings are:

      • UTF-8
      • UTF-16LE
      • UTF-16BE

      Returns Promise<string>

    • Fetch the response body as an Uint8Array. Note that the underlying ArrayBuffer may contain more data than just the body.

      Returns Promise<Uint8Array<ArrayBufferLike>>

    • Get the body as a ReadableStream.

      Returns ReadableStream<Uint8Array<ArrayBufferLike>>