UNPKG

byte-rw

Version:

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

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