MCPcopy Create free account
hub / github.com/apache/cloudstack / inflate

Method inflate

systemvm/agent/noVNC/core/inflator.js:36–60  ·  view source on GitHub ↗
(expected)

Source from the content-addressed store, hash-verified

34 }
35
36 inflate(expected) {
37 // resize our output buffer if it's too small
38 // (we could just use multiple chunks, but that would cause an extra
39 // allocation each time to flatten the chunks)
40 if (expected > this.chunkSize) {
41 this.chunkSize = expected;
42 this.strm.output = new Uint8Array(this.chunkSize);
43 }
44
45 /* eslint-disable camelcase */
46 this.strm.next_out = 0;
47 this.strm.avail_out = expected;
48 /* eslint-enable camelcase */
49
50 let ret = inflate(this.strm, 0); // Flush argument not used.
51 if (ret < 0) {
52 throw new Error("zlib inflate failed");
53 }
54
55 if (this.strm.next_out != expected) {
56 throw new Error("Incomplete zlib block");
57 }
58
59 return new Uint8Array(this.strm.output.buffer, 0, this.strm.next_out);
60 }
61
62 reset() {
63 inflateReset(this.strm);

Callers 10

_handleServerCutTextMethod · 0.80
decodeRectMethod · 0.80
decodeRectMethod · 0.80
_readPixelsMethod · 0.80
_decodePaletteTileMethod · 0.80
_decodeRLEPaletteTileMethod · 0.80
_readRLELengthMethod · 0.80
_copyFilterMethod · 0.80
_paletteFilterMethod · 0.80
_gradientFilterMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected