Skip to content

RandomAccessSource

Defined in: packages/filecoin-encryption-envelope/src/range/source.ts:19

One immutable encoded FEE object, readable by byte range.

readonly size: number

Defined in: packages/filecoin-encryption-envelope/src/range/source.ts:21

Exact size of the encoded object: envelope plus detached ciphertext.

openRange(offset, length, signal?): Promise<ReadableStream<Uint8Array<ArrayBufferLike>>>

Defined in: packages/filecoin-encryption-envelope/src/range/source.ts:37

Open the half-open byte range [offset, offset + length). The returned stream must produce exactly length bytes and then close; a short or long response is rejected rather than reinterpreted, and a stream error propagates unchanged.

During envelope setup (parse, decryptRange, decryptRangeWith), the caller’s options.signal is passed as the third argument when provided. For ciphertext spans opened by RangeResult.stream, the stream always passes its own stream-scoped AbortSignal, which mirrors options.signal when supplied and also aborts if the range stream is cancelled or fails. Adapters that ignore the third argument remain supported: range operations still reject promptly with signal.reason and cancel any active or late-arriving stream.

Parameter Type
offset number
length number
signal? AbortSignal

Promise<ReadableStream<Uint8Array<ArrayBufferLike>>>