()
| 107 | return this.#bytes.slice(read, read + n).buffer; |
| 108 | } |
| 109 | getChunk() { |
| 110 | const bytes = this.#bytes; |
| 111 | this.#bytes = undefined; |
| 112 | if (bytes.i) { |
| 113 | delete bytes.i; |
| 114 | bytes.buffer.resize(this.#write); |
| 115 | return bytes; |
| 116 | } |
| 117 | |
| 118 | return bytes.slice(0, this.#write); |
| 119 | } |
| 120 | get bytesAvailable() { |
| 121 | return this.#write - this.#read; |
| 122 | } |
no test coverage detected