MCPcopy Index your code
hub / github.com/molnarg/node-http2 / concat

Function concat

lib/protocol/compressor.js:1338–1350  ·  view source on GitHub ↗
(buffers)

Source from the content-addressed store, hash-verified

1336
1337// Concatenate an array of buffers into a new buffer
1338function concat(buffers) {
1339 var size = 0;
1340 for (var i = 0; i < buffers.length; i++) {
1341 size += buffers[i].length;
1342 }
1343
1344 var concatenated = new Buffer(size);
1345 for (var cursor = 0, j = 0; j < buffers.length; cursor += buffers[j].length, j++) {
1346 buffers[j].copy(concatenated, cursor);
1347 }
1348
1349 return concatenated;
1350}
1351
1352// Cut `buffer` into chunks not larger than `size`
1353function cut(buffer, size) {

Callers 1

compressor.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected