@suchipi/resizable-buffer
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

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

/@suchipi/resizable-buffer/

    Package Sidebar

    Install

    npm i @suchipi/resizable-buffer

    Weekly Downloads

    2

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    3.73 kB

    Total Files

    6

    Last publish

    Collaborators

    • suchipi