Skip to content

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.

readonly size: number | undefined;

Defined in: io/reader.ts:15

Total length in bytes, or undefined if the source size is unknown.

optional close(): Promise<void>;

Defined in: io/reader.ts:18

Release any held resource (file handle, cache). Optional.

Promise<void>


read(offset, length): Promise<Uint8Array<ArrayBufferLike>>;

Defined in: io/reader.ts:16

Parameter Type
offset number
length number

Promise<Uint8Array<ArrayBufferLike>>