byte-rw
Version:
Byte reader/writer for buffers and streams in typescript/javascript
34 lines • 1.6 kB
TypeScript
import { DataViewChunk, DataViewChunkedWorker } from "./dataview-chunk.js";
import { DataViewByteReader } from "./reader.js";
export declare abstract class DataViewByteReaderChunked extends DataViewByteReader implements DataViewChunkedWorker {
defaultChunkSize: number;
protected pendingChunks: DataViewChunk[];
private _currentChunk;
protected get currentChunk(): DataViewChunk;
protected set currentChunk(currentChunk: DataViewChunk);
protected get _bytesRemaining(): number;
protected get _bytesRemaining_currentChunk(): number;
constructor(littleEndian?: boolean, defaultChunkSize?: number);
/**
* Fills more data to be read into the current chunk and possibly pending
* chunks, adding more pending chunk(s) if needed
*
* @param minReadLength the minimum number of bytes to read into the
* current and/or pending chunks
* @returns the number of bytes that were actually filled
*/
protected abstract fill(minReadLength: number): number;
protected pendChunk(chunk?: DataViewChunk): DataViewChunk;
/**
* Attempts to ensure that a specified number of bytes are available in the
* current chunk.
*
* @param bytes the number of bytes to fill (total bytesWritten should
* increase by this amount at least)
* @returns the number of bytes at least made available in the current
* chunk, up to the requested number of bytes
*/
protected tryEnsureAvailable(bytes: number): number;
tryReadBytes(view: ArrayBufferView): number;
}
//# sourceMappingURL=reader-chunked.d.ts.map