UNPKG

byte-rw

Version:

Byte reader/writer for buffers and streams in typescript/javascript

60 lines 1.71 kB
import { ByteReader } from "../interfaces/index.js"; export declare class DataViewByteReader implements ByteReader { littleEndian: boolean; protected _dataview: DataView; protected _isComplete: boolean; protected _byteOffset: number; protected get _bytesRemaining(): number; get dataview(): DataView; set dataview(dataview: DataView); isComplete(): boolean; constructor(dataview: DataView, littleEndian?: boolean); protected updateIsComplete(): boolean; /** * Attempts to ensure that a specified number of bytes are available in the * current dataview. * * @param bytes the number of bytes to request available in the current * dataview * @returns the number of bytes at least made available in the current * dataview, up to the requested number of bytes */ protected tryEnsureAvailable(bytes: number): number; protected ensureAvailable(bytes: number): void; /** * Gets the next Float32 value */ readFloat32(): number; /** * Gets the next Float64 value */ readFloat64(): number; /** * Gets the next Int8 value */ readInt8(): number; /** * Gets the next Int16 value */ readInt16(): number; /** * Gets the next Int32 value */ readInt32(): number; /** * Gets the next Uint8 value */ readUint8(): number; /** * Gets the next Uint16 value */ readUint16(): number; /** * Gets the next Uint32 value */ readUint32(): number; tryReadBytes(view: ArrayBufferView): number; readBytes(view: ArrayBufferView): void; readString(): string; } //# sourceMappingURL=reader.d.ts.map