JavaScript 65.5%
Python 17.8%
CSS 13%
HTML 3.7%
1/*2 * noVNC: HTML5 VNC client3 * Copyright (C) 2020 The noVNC authors4 * Licensed under MPL 2.0 (see LICENSE.txt)5 *6 * See README.md for usage and integration instructions.7 */89import { inflateInit, inflate, inflateReset } from "../vendor/pako/lib/zlib/inflate.js";10import ZStream from "../vendor/pako/lib/zlib/zstream.js";1112export default class Inflate {13 constructor() {14 this.strm = new ZStream();15 this.chunkSize = 1024 * 10 * 10;16 this.strm.output = new Uint8Array(this.chunkSize);1718 inflateInit(this.strm);19 }2021 setInput(data) {22 if (!data) {23 //FIXME: flush remaining data.24 /* eslint-disable camelcase */25 this.strm.input = null;26 this.strm.avail_in = 0;27 this.strm.next_in = 0;28 } else {29 this.strm.input = data;30 this.strm.avail_in = this.strm.input.length;31 this.strm.next_in = 0;32 /* eslint-enable camelcase */33 }34 }3536 inflate(expected) {37 // resize our output buffer if it's too small38 // (we could just use multiple chunks, but that would cause an extra39 // 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 }4445 /* eslint-disable camelcase */46 this.strm.next_out = 0;47 this.strm.avail_out = expected;48 /* eslint-enable camelcase */4950 let ret = inflate(this.strm, 0); // Flush argument not used.51 if (ret < 0) {52 throw new Error("zlib inflate failed");53 }5455 if (this.strm.next_out != expected) {56 throw new Error("Incomplete zlib block");57 }5859 return new Uint8Array(this.strm.output.buffer, 0, this.strm.next_out);60 }6162 reset() {63 inflateReset(this.strm);64 }65}66