Resolves to EXACTLY length bytes starting at offset, or rejects with
an FcbError. Never returns a short buffer, and never clamps a range
that crosses the end of the resource. The returned array MAY be a view
into a buffer the reader reuses on its next call, so a caller that needs
the bytes to outlive the next read must copy them.
Optionalopts: ReadOptsThe resource's total byte length. Synchronous by contract: every source
learns its size when it opens (a stat, blob.size, or a
Content-Range at open time), so the reader's layout arithmetic never
has to await.
StaticopenOpens the file and stats it up front so size() can stay synchronous
for the reader's whole lifetime, matching every other RangeReader.
Node's own open/stat errors (ENOENT, EACCES, ...) are never surfaced
raw -- callers of this package should only ever have to catch
FcbError.
RangeReaderover anode:fsfile handle -- the source used by CLI and server consumers reading a local file, and what fromFile builds.Owns an open file descriptor for its whole lifetime, because later queries seek back into the header and the indices; call
close()(orFcbReader.close, orawait using) to release it. Node's ownopen/stat/readerrors are never surfaced raw: they are wrapped asFcbErrorwithcodeIoError, so a caller of this package only ever has to catchFcbError.Unbuffered: a sequential scan costs two
preadsyscalls per feature. Wrap it in aBufferedRangeReaderif that matters.