MCPcopy Index your code
hub / github.com/diegomura/react-pdf / _write

Method _write

packages/pdfkit/src/reference.js:36–57  ·  view source on GitHub ↗
(chunk, encoding, callback)

Source from the content-addressed store, hash-verified

34 }
35
36 _write(chunk, encoding, callback) {
37 if (!Buffer.isBuffer(chunk)) {
38 chunk = Buffer.from(chunk + '\n', 'binary');
39 }
40
41 this.uncompressedLength += chunk.length;
42 if (this.data.Length == null) {
43 this.data.Length = 0;
44 }
45
46 if (this.compress) {
47 if (!this.deflate) {
48 this.initDeflate();
49 }
50 this.deflate.write(chunk);
51 } else {
52 this.chunks.push(chunk);
53 this.data.Length += chunk.length;
54 }
55
56 return callback();
57 }
58
59 end() {
60 super.end(...arguments);

Callers 1

finalizeMethod · 0.45

Calls 3

initDeflateMethod · 0.95
pushMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected