MCPcopy
hub / github.com/scality/cloudserver / write

Function write

lib/routes/veeam/utils.js:51–60  ·  view source on GitHub ↗
(chunk, _enc, cb)

Source from the content-addressed store, hash-verified

49 const chunks = [];
50 const collector = new Writable({
51 write(chunk, _enc, cb) {
52 totalLength += chunk.length;
53 if (totalLength > parsedContentLength) {
54 log.error('data stream exceed announced size',
55 { parsedContentLength, overflow: totalLength });
56 return cb(errors.InternalError);
57 }
58 chunks.push(chunk);
59 return cb();
60 },
61 final(cb) {
62 settle(null, Buffer.concat(chunks).toString());
63 cb();

Callers

nothing calls this directly

Calls 1

errorMethod · 0.80

Tested by

no test coverage detected