1.0.0 • Published 1 year ago

@suchipi/resizable-buffer v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@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;
}
1.0.0

1 year ago