UNPKG

@playcanvas/splat-transform

Version:

Library and CLI tool for 3D Gaussian splat format conversion and transformation

27 lines (26 loc) 966 B
import { ReadStream } from './file-system'; /** * ReadStream wrapper that adds read-ahead buffering to reduce async overhead. * Reads larger chunks from the inner stream and buffers excess data for * subsequent small reads. Useful for sources with high per-call overhead. * * @example * // Wrap a stream with 4MB read-ahead buffering * const buffered = new BufferedReadStream(rawStream, 4 * 1024 * 1024); * const data = await buffered.readAll(); */ declare class BufferedReadStream extends ReadStream { private inner; private chunkSize; private buffer; private bufferOffset; /** * Create a caching wrapper around a stream. * @param inner - The underlying stream to read from * @param chunkSize - Minimum bytes to read at once from inner stream (default 64KB) */ constructor(inner: ReadStream, chunkSize?: number); pull(target: Uint8Array): Promise<number>; close(): void; } export { BufferedReadStream };