RandomAccessReader
Defined in: io/reader.ts:13
A seekable byte source. Every fits-js entry point that reads a file
works through this interface, so the same parser runs over an in-memory
buffer, a browser Blob, a Node file, or an HTTP endpoint with Range
support.
read returns the bytes for [offset, offset + length), or fewer at the
end of the source. The returned array may be a view into an internal
buffer; treat it as read-only and copy if you need to retain it.
Properties
Section titled “Properties”readonly size: number | undefined;Defined in: io/reader.ts:15
Total length in bytes, or undefined if the source size is unknown.
Methods
Section titled “Methods”close()?
Section titled “close()?”optional close(): Promise<void>;Defined in: io/reader.ts:18
Release any held resource (file handle, cache). Optional.
Returns
Section titled “Returns”Promise<void>
read()
Section titled “read()”read(offset, length): Promise<Uint8Array<ArrayBufferLike>>;Defined in: io/reader.ts:16
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
offset |
number |
length |
number |
Returns
Section titled “Returns”Promise<Uint8Array<ArrayBufferLike>>