META-INF.resources.bower_components.jszip.lib.flate.min.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jwebmp-data-tables Show documentation
Show all versions of jwebmp-data-tables Show documentation
The JWebSwing implementation for Data Tables
"use strict";var USE_TYPEDARRAY=typeof Uint8Array!=="undefined"&&typeof Uint16Array!=="undefined"&&typeof Uint32Array!=="undefined";var pako=require("pako");var utils=require("./utils");var GenericWorker=require("./stream/GenericWorker");var ARRAY_TYPE=USE_TYPEDARRAY?"uint8array":"array";exports.magic="\b\0";function FlateWorker(action,options){GenericWorker.call(this,"FlateWorker/"+action);this._pako=null;this._pakoAction=action;this._pakoOptions=options;this.meta={}}utils.inherits(FlateWorker,GenericWorker);FlateWorker.prototype.processChunk=function(chunk){this.meta=chunk.meta;if(this._pako===null){this._createPako()}this._pako.push(utils.transformTo(ARRAY_TYPE,chunk.data),false)};FlateWorker.prototype.flush=function(){GenericWorker.prototype.flush.call(this);if(this._pako===null){this._createPako()}this._pako.push([],true)};FlateWorker.prototype.cleanUp=function(){GenericWorker.prototype.cleanUp.call(this);this._pako=null};FlateWorker.prototype._createPako=function(){this._pako=new pako[this._pakoAction]({raw:true,level:this._pakoOptions.level||-1});var self=this;this._pako.onData=function(data){self.push({data:data,meta:self.meta})}};exports.compressWorker=function(compressionOptions){return new FlateWorker("Deflate",compressionOptions)};exports.uncompressWorker=function(){return new FlateWorker("Inflate",{})};
© 2015 - 2025 Weber Informatics LLC | Privacy Policy