Grows the buffer's capacity, if necessary, to guarantee space for * another `n` bytes. After `.grow(n)`, at least `n` bytes can be written to * the buffer without another allocation. If `n` is negative, `.grow()` will * throw. If the buffer can't grow it will throw an error. * * Based
(n: number)
| 395 | * @param n The number of bytes to grow the buffer by. |
| 396 | */ |
| 397 | grow(n: number) { |
| 398 | if (n < 0) { |
| 399 | throw new Error("Buffer growth cannot be negative"); |
| 400 | } |
| 401 | const m = this.#grow(n); |
| 402 | this.#reslice(m); |
| 403 | } |
| 404 | |
| 405 | /** |
| 406 | * Reads data from `r` until EOF (`null`) and appends it to the buffer, |
no test coverage detected