]>
git.proxmox.com Git - mirror_novnc.git/blob - utils/inflator.partial.js
2522d78164fee2e43d3a5a0cde07452cbedbfed5
1 var zlib
= require('./lib/zlib/inflate.js');
2 var ZStream
= require('./lib/zlib/zstream.js');
4 var Inflate = function () {
5 this.strm
= new ZStream();
6 this.chunkSize
= 1024 * 10 * 10;
7 this.strm
.output
= new Uint8Array(this.chunkSize
);
10 zlib
.inflateInit(this.strm
, this.windowBits
);
14 inflate: function (data
, flush
) {
15 this.strm
.input
= data
;
16 this.strm
.avail_in
= this.strm
.input
.length
;
17 this.strm
.next_in
= 0;
18 this.strm
.next_out
= 0;
20 this.strm
.avail_out
= this.chunkSize
;
22 zlib
.inflate(this.strm
, flush
);
24 return new Uint8Array(this.strm
.output
.buffer
, 0, this.strm
.next_out
);
28 zlib
.inflateReset(this.strm
);
32 module
.exports
= {Inflate
: Inflate
};