public int init(int w, boolean nowrap){ finished = false; istate=new Inflate(this); return istate.inflateInit(nowrap?-w:w); }
public int inflate(int f){ if(istate==null) return Z_STREAM_ERROR; int ret = istate.inflate(f); if(ret == Z_STREAM_END) finished = true; return ret; }
public int inflateEnd(){ if(istate==null) return Z_STREAM_ERROR; int ret=istate.inflateEnd(this); istate = null; return ret; } public int inflateSync(){
int inflateInit(ZStream z, int w){ z.msg = null; blocks = null; // handle undocumented nowrap option (no zlib header or check) nowrap = 0; if(w < 0){ w = - w; nowrap = 1; } // set window size if(w<8 ||w>15){ inflateEnd(z); return Z_STREAM_ERROR; } wbits=w; z.istate.blocks=new InfBlocks(z, z.istate.nowrap!=0 ? null : this, 1<<w); // reset state inflateReset(z); return Z_OK; }
public int setDictionary(byte[] dictionary, int dictLength){ if(istate == null) return Z_STREAM_ERROR; return istate.inflateSetDictionary(dictionary, dictLength); }
public int inflateSync(){ if(istate == null) return Z_STREAM_ERROR; return istate.inflateSync(this); } public int inflateSetDictionary(byte[] dictionary, int dictLength){
inflateReset(); z.total_in=r; z.total_out = w; this.mode = BLOCKS;
try { r=readBytes(2, r, f); } catch(Return e){ return e.r; } checksum(2, this.need); try { r=readBytes(4, r, f); } catch(Return e){ return e.r; } try { r=readBytes(2, r, f); } catch(Return e){ return e.r; } checksum(2, this.need); try { r=readBytes(4, r, f); } catch(Return e){ return e.r; } if(gheader!=null) gheader.time = this.need; if ((flags & 0x0200)!=0){ checksum(4, this.need); try { r=readBytes(2, r, f); } catch(Return e){ return e.r; } if(gheader!=null){ checksum(2, this.need); try { r=readBytes(2, r, f); } catch(Return e){ return e.r; } if(gheader!=null){
public int getOS() { return inflater.istate.getGZIPHeader().getOS(); }
public void readHeader() throws IOException { byte[] empty = "".getBytes(); inflater.setInput(empty, 0, 0, false); inflater.setOutput(empty, 0, 0); int err = inflater.inflate(JZlib.Z_NO_FLUSH); if(!inflater.istate.inParsingHeader()){ return; } byte[] b1 = new byte[1]; do{ int i = in.read(b1); if(i<=0) throw new IOException("no input"); inflater.setInput(b1); err = inflater.inflate(JZlib.Z_NO_FLUSH); if(err!=0/*Z_OK*/) throw new IOException(inflater.msg); } while(inflater.istate.inParsingHeader()); }
int inflateInit(ZStream z, int w){ z.msg = null; blocks = null; // handle undocumented nowrap option (no zlib header or check) nowrap = 0; if(w < 0){ w = - w; nowrap = 1; } // set window size if(w<8 ||w>15){ inflateEnd(z); return Z_STREAM_ERROR; } wbits=w; z.istate.blocks=new InfBlocks(z, z.istate.nowrap!=0 ? null : this, 1<<w); // reset state inflateReset(z); return Z_OK; }
public int setDictionary(byte[] dictionary, int dictLength){ if(istate == null) return Z_STREAM_ERROR; return istate.inflateSetDictionary(dictionary, dictLength); }
public int inflateSync(){ if(istate == null) return Z_STREAM_ERROR; return istate.inflateSync(this); } public int inflateSetDictionary(byte[] dictionary, int dictLength){
inflateReset(z); z.total_in=r; z.total_out = w; z.istate.mode = BLOCKS;
try { r=readBytes(2, r, f); } catch(Return e){ return e.r; } checksum(2, this.need); try { r=readBytes(4, r, f); } catch(Return e){ return e.r; } try { r=readBytes(2, r, f); } catch(Return e){ return e.r; } checksum(2, this.need); try { r=readBytes(4, r, f); } catch(Return e){ return e.r; } if(gheader!=null) gheader.time = this.need; if ((flags & 0x0200)!=0){ checksum(4, this.need); try { r=readBytes(2, r, f); } catch(Return e){ return e.r; } if(gheader!=null){ checksum(2, this.need); try { r=readBytes(2, r, f); } catch(Return e){ return e.r; } if(gheader!=null){
public String getComment() { return inflater.istate.getGZIPHeader().getComment(); }
public void readHeader() throws IOException { byte[] empty = "".getBytes(); inflater.setInput(empty, 0, 0, false); inflater.setOutput(empty, 0, 0); int err = inflater.inflate(JZlib.Z_NO_FLUSH); if(!inflater.istate.inParsingHeader()){ return; } byte[] b1 = new byte[1]; do{ int i = in.read(b1); if(i<=0) throw new IOException("no input"); inflater.setInput(b1); err = inflater.inflate(JZlib.Z_NO_FLUSH); if(err!=0/*Z_OK*/) throw new IOException(inflater.msg); } while(inflater.istate.inParsingHeader()); }
public int init(int w, boolean nowrap){ finished = false; istate=new Inflate(this); return istate.inflateInit(nowrap?-w:w); }
int inflateInit(ZStream z, int w){ z.msg = null; blocks = null; // handle undocumented nowrap option (no zlib header or check) nowrap = 0; if(w < 0){ w = - w; nowrap = 1; } // set window size if(w<8 ||w>15){ inflateEnd(z); return Z_STREAM_ERROR; } wbits=w; z.istate.blocks=new InfBlocks(z, z.istate.nowrap!=0 ? null : this, 1<<w); // reset state inflateReset(z); return Z_OK; }
public int inflateSetDictionary(byte[] dictionary, int dictLength){ if(istate == null) return Z_STREAM_ERROR; return istate.inflateSetDictionary(this, dictionary, dictLength); }