public void write(byte b[], int off, int len) throws IOException { if(len==0) return; int err; z.next_in=b; z.next_in_index=off; z.avail_in=len; do{ z.next_out=buf; z.next_out_index=0; z.avail_out=bufsize; if(compress) err=z.deflate(flush); else err=z.inflate(flush); if(err!=JZlib.Z_OK) throw new ZStreamException((compress?"de":"in")+"flating: "+z.msg); out.write(buf, 0, bufsize-z.avail_out); } while(z.avail_in>0 || z.avail_out==0); }
public void write(byte b[], int off, int len) throws IOException { if(len==0) return; int err; z.next_in=b; z.next_in_index=off; z.avail_in=len; do{ z.next_out=buf; z.next_out_index=0; z.avail_out=bufsize; if(compress) err=z.deflate(flush); else err=z.inflate(flush); if(err!=JZlib.Z_OK) throw new ZStreamException((compress?"de":"in")+"flating: "+z.msg); out.write(buf, 0, bufsize-z.avail_out); } while(z.avail_in>0 || z.avail_out==0); }
public void write(byte b[], int off, int len) throws IOException { if(len==0) return; int err; z.next_in=b; z.next_in_index=off; z.avail_in=len; do{ z.next_out=buf; z.next_out_index=0; z.avail_out=bufsize; if(compress) err=z.deflate(flush); else err=z.inflate(flush); if(err!=JZlib.Z_OK) throw new ZStreamException((compress?"de":"in")+"flating: "+z.msg); out.write(buf, 0, bufsize-z.avail_out); } while(z.avail_in>0 || z.avail_out==0); }
return(-1); if(err!=JZlib.Z_OK && err!=JZlib.Z_STREAM_END) throw new ZStreamException((compress ? "de" : "in")+"flating: "+z.msg); if((nomoreinput||err==JZlib.Z_STREAM_END)&&(z.avail_out==len)) return(-1);
return(-1); if(err!=JZlib.Z_OK && err!=JZlib.Z_STREAM_END) throw new ZStreamException((compress ? "de" : "in")+"flating: "+z.msg); if((nomoreinput||err==JZlib.Z_STREAM_END)&&(z.avail_out==len)) return(-1);
return(-1); if(err!=JZlib.Z_OK && err!=JZlib.Z_STREAM_END) throw new ZStreamException((compress ? "de" : "in")+"flating: "+z.msg); if(nomoreinput&&(z.avail_out==len)) return(-1);
public void finish() throws IOException { int err; do{ z.next_out=buf; z.next_out_index=0; z.avail_out=bufsize; if(compress){ err=z.deflate(JZlib.Z_FINISH); } else{ err=z.inflate(JZlib.Z_FINISH); } if(err!=JZlib.Z_STREAM_END && err != JZlib.Z_OK) throw new ZStreamException((compress?"de":"in")+"flating: "+z.msg); if(bufsize-z.avail_out>0){ out.write(buf, 0, bufsize-z.avail_out); } } while(z.avail_in>0 || z.avail_out==0); flush(); } public void end() {
public void finish() throws IOException { int err; do{ z.next_out=buf; z.next_out_index=0; z.avail_out=bufsize; if(compress){ err=z.deflate(JZlib.Z_FINISH); } else{ err=z.inflate(JZlib.Z_FINISH); } if(err!=JZlib.Z_STREAM_END && err != JZlib.Z_OK) throw new ZStreamException((compress?"de":"in")+"flating: "+z.msg); if(bufsize-z.avail_out>0){ out.write(buf, 0, bufsize-z.avail_out); } } while(z.avail_in>0 || z.avail_out==0); flush(); } public void end() {
public void finish() throws IOException { int err; do{ z.next_out=buf; z.next_out_index=0; z.avail_out=bufsize; if(compress){ err=z.deflate(JZlib.Z_FINISH); } else{ err=z.inflate(JZlib.Z_FINISH); } if(err!=JZlib.Z_STREAM_END && err != JZlib.Z_OK) throw new ZStreamException((compress?"de":"in")+"flating: "+z.msg); if(bufsize-z.avail_out>0){ out.write(buf, 0, bufsize-z.avail_out); } } while(z.avail_in>0 || z.avail_out==0); try { flush(); } catch (IOException ignored) { } } public void end() throws IOException {
public int read(byte[] b, int off, int len) throws IOException { if(compress){ deflater.setOutput(b, off, len); while(true){ int datalen = in.read(buf, 0, buf.length); if(datalen == -1) return -1; deflater.setInput(buf, 0, datalen, true); int err = deflater.deflate(flush); if(deflater.next_out_index>0) return deflater.next_out_index; if(err == JZlib.Z_STREAM_END) return 0; if(err == JZlib.Z_STREAM_ERROR || err == JZlib.Z_DATA_ERROR){ throw new ZStreamException("deflating: "+deflater.msg); } } } else{ return iis.read(b, off, len); } }
public int read(byte[] b, int off, int len) throws IOException { if(compress){ deflater.setOutput(b, off, len); while(true){ int datalen = in.read(buf, 0, buf.length); if(datalen == -1) return -1; deflater.setInput(buf, 0, datalen, true); int err = deflater.deflate(flush); if(deflater.next_out_index>0) return deflater.next_out_index; if(err == JZlib.Z_STREAM_END) return 0; if(err == JZlib.Z_STREAM_ERROR || err == JZlib.Z_DATA_ERROR){ throw new ZStreamException("deflating: "+deflater.msg); } } } else{ return iis.read(b, off, len); } }
public void write(byte b[], int off, int len) throws IOException { if(len==0) return; if(compress){ dos.write(b, off, len); } else { inflater.setInput(b, off, len, true); int err = JZlib.Z_OK; while(inflater.avail_in>0){ inflater.setOutput(buf, 0, buf.length); err = inflater.inflate(flush); if(inflater.next_out_index>0) out.write(buf, 0, inflater.next_out_index); if(err != JZlib.Z_OK) break; } if(err != JZlib.Z_OK) throw new ZStreamException("inflating: "+inflater.msg); return; } }
public int read(byte[] b, int off, int len) throws IOException { if(compress){ deflater.setOutput(b, off, len); while(true){ int datalen = in.read(buf, 0, buf.length); if(datalen == -1) return -1; deflater.setInput(buf, 0, datalen, true); int err = deflater.deflate(flush); if(deflater.next_out_index>0) return deflater.next_out_index; if(err == JZlib.Z_STREAM_END) return 0; if(err == JZlib.Z_STREAM_ERROR || err == JZlib.Z_DATA_ERROR){ throw new ZStreamException("deflating: "+deflater.msg); } } } else{ return iis.read(b, off, len); } }
public void write(byte b[], int off, int len) throws IOException { if(len==0) return; if(compress){ dos.write(b, off, len); } else { inflater.setInput(b, off, len, true); int err = JZlib.Z_OK; while(inflater.avail_in>0){ inflater.setOutput(buf, 0, buf.length); err = inflater.inflate(flush); if(inflater.next_out_index>0) out.write(buf, 0, inflater.next_out_index); if(err != JZlib.Z_OK) break; } if(err != JZlib.Z_OK) throw new ZStreamException("inflating: "+inflater.msg); return; } }
public void write(byte b[], int off, int len) throws IOException { if(len==0) return; if(compress){ dos.write(b, off, len); } else { inflater.setInput(b, off, len, true); int err = JZlib.Z_OK; while(inflater.avail_in>0){ inflater.setOutput(buf, 0, buf.length); err = inflater.inflate(flush); if(inflater.next_out_index>0) out.write(buf, 0, inflater.next_out_index); if(err != JZlib.Z_OK) break; } if(err != JZlib.Z_OK) throw new ZStreamException("inflating: "+inflater.msg); return; } }