interface AutogrowOptions

Configuration options for automatic buffer growth.

These options control how the autoGrowBuffer function manages buffer resizing when encoding operations require more space than initially available.

Properties

optional
initialSize: number

Initial buffer size in bytes. Must be greater than 0 and less than or equal to maxByteLength. Defaults to 4096 bytes (4KB).

optional
maxByteLength: number

Maximum buffer size in bytes. The buffer will not grow beyond this limit. When reached, a RangeError will be thrown. Defaults to 400MB.

optional
growthFactor: number

Growth factor multiplier for buffer resizing. Must be greater than 1. Each resize multiplies the current size by this factor. Defaults to 2 (doubling).

Usage

import { type AutogrowOptions } from "mod.ts";