@suchipi/resizable-buffer
v1.0.0
Published
"Resize" an ArrayBuffer (via slice or new+copy)
Downloads
1
Readme
@suchipi/resizable-buffer
Helper class for "resizing" an ArrayBuffer.
- When reducing the size, ArrayBuffer.slice is used (cheap).
- When increasing the size, a new ArrayBuffer is created and the contents are copied over (expensive).
export declare class ResizableBuffer {
constructor(byteLength: number);
buffer: ArrayBuffer;
resizeTo(byteLength: number): void;
resizeBy(bytes: number): void;
}