* Resets to an empty buffer. * * @example Basic usage * ```ts * import { assert } from "@std/assert"; * import { Buffer } from "@std/streams/buffer"; * * const array = new Uint8Array([0, 1, 2]); * const buf = new Buffer(array.buffer); * assert(!buf.empty()); * * // R
()
| 344 | * ``` |
| 345 | */ |
| 346 | reset() { |
| 347 | this.#reslice(0); |
| 348 | this.#off = 0; |
| 349 | } |
| 350 | |
| 351 | #tryGrowByReslice(n: number) { |
| 352 | const l = this.#buf.byteLength; |
no test coverage detected