MCPcopy Create free account
hub / github.com/foliojs/pdfkit / write

Method write

lib/reference.js:22–36  ·  view source on GitHub ↗
(chunk)

Source from the content-addressed store, hash-verified

20 }
21
22 write(chunk) {
23 if (!(chunk instanceof Uint8Array)) {
24 chunk = Buffer.from(chunk + '\n', 'binary');
25 }
26
27 this.uncompressedLength += chunk.length;
28 if (this.data.Length == null) {
29 this.data.Length = 0;
30 }
31 this.buffer.push(chunk);
32 this.data.Length += chunk.length;
33 if (this.compress) {
34 this.data.Filter = 'FlateDecode';
35 }
36 }
37
38 end(chunk) {
39 if (chunk) {

Callers 1

endMethod · 0.95

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected