Read/write IOStream backed by a Blob or File object.
Reads are performed lazily — each BlobSegment is fetched from the blob on
first access and the result is cached on the segment, so subsequent reads
of the same range are purely in-memory with no async overhead. When a
readBlock call spans multiple uncached segments, all outstanding
arrayBuffer() calls are issued in parallel via Promise.all,
minimising round-trips.
Writes are captured in a piece table — a list of segments that are
either a byte-range reference into the original blob (BlobSegment) or a
small in-memory Uint8Array buffer (BufferSegment). The total logical
length is maintained as a cached field so that length() and most seeks are
O(1).
The modified content can be assembled as a new Blob (preserving the
source MIME type) via BlobStream.toBlob.
Read/write IOStream backed by a
BloborFileobject.Reads are performed lazily — each
BlobSegmentis fetched from the blob on first access and the result is cached on the segment, so subsequent reads of the same range are purely in-memory with no async overhead. When areadBlockcall spans multiple uncached segments, all outstandingarrayBuffer()calls are issued in parallel viaPromise.all, minimising round-trips.Writes are captured in a piece table — a list of segments that are either a byte-range reference into the original blob (
BlobSegment) or a small in-memoryUint8Arraybuffer (BufferSegment). The total logical length is maintained as a cached field so thatlength()and most seeks are O(1).The modified content can be assembled as a new
Blob(preserving the source MIME type) via BlobStream.toBlob.