@flowscripter/pluggable-io-framework-api
    Preparing search index...

    Interface RangeReadable<K>

    Capability of a handle that can serve an arbitrary byte range directly.

    interface RangeReadable<K extends PayloadKind = PayloadKind> {
        readRange(
            start: number,
            end: number,
        ): Promise<ReadableStream<ItemOfKind<K>>>;
    }

    Type Parameters

    Index
    • Opens a new stream of the bytes from offset start (inclusive) to offset end (exclusive), independent of the handle's own stream.

      • The range is clamped to the end of the data: an end past the end reads up to the last byte, so Number.MAX_SAFE_INTEGER reads to the end.
      • When start >= end, or start is at or past the end of the data, the stream is empty.
      • Offsets are non-negative integers in bytes.

      Parameters

      • start: number
      • end: number

      Returns Promise<ReadableStream<ItemOfKind<K>>>