(n)
| 102 | } |
| 103 | |
| 104 | async _accumulate(n) { |
| 105 | if (this._ended) return |
| 106 | // Expand the buffer until we have N bytes of data |
| 107 | // or we've reached the end of the stream |
| 108 | const buffers = [this.buffer] |
| 109 | while (this.cursor + n > lengthBuffers(buffers)) { |
| 110 | const nextbuffer = await this._next() |
| 111 | if (this._ended) break |
| 112 | buffers.push(nextbuffer) |
| 113 | } |
| 114 | this.buffer = Buffer.concat(buffers) |
| 115 | } |
| 116 | |
| 117 | async _loadnext() { |
| 118 | this._discardedBytes += this.buffer.length |
no test coverage detected