MCPcopy Create free account
hub / github.com/isomorphic-git/isomorphic-git / _accumulate

Method _accumulate

src/utils/StreamReader.js:104–115  ·  view source on GitHub ↗
(n)

Source from the content-addressed store, hash-verified

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

Callers 2

readMethod · 0.95
skipMethod · 0.95

Calls 2

_nextMethod · 0.95
lengthBuffersFunction · 0.85

Tested by

no test coverage detected