* Resets the contents * * @example Usage * ```ts * import { Buffer } from "@std/io/buffer"; * import { assertEquals } from "@std/assert/equals"; * * const buf = new Buffer(); * await buf.write(new TextEncoder().encode("Hello, world!")); * buf.reset(); * assertEquals(buf
()
| 198 | * ``` |
| 199 | */ |
| 200 | reset() { |
| 201 | this.#reslice(0); |
| 202 | this.#off = 0; |
| 203 | } |
| 204 | |
| 205 | #tryGrowByReslice(n: number) { |
| 206 | const l = this.#buf.byteLength; |
no test coverage detected