int resultCode = z.inflate(JZlib.Z_SYNC_FLUSH); int outputLength = z.next_out_index - oldNextOutIndex; if (outputLength > 0) {
impl.setOutput(buf, off, nbytes); int errCode = impl.inflate(0); switch (errCode) { case JZlib.Z_OK:
@Override public void uncompress(Buffer from, Buffer to) throws TransportException { inflater.setNextIn(from.array()); inflater.setNextInIndex(from.rpos()); inflater.setAvailIn(from.available()); while (true) { inflater.setNextOut(tempBuf); inflater.setNextOutIndex(0); inflater.setAvailOut(BUF_SIZE); final int status = inflater.inflate(JZlib.Z_PARTIAL_FLUSH); switch (status) { case JZlib.Z_OK: to.putRawBytes(tempBuf, 0, BUF_SIZE - inflater.getAvailOut()); break; case JZlib.Z_BUF_ERROR: return; default: throw new TransportException(DisconnectReason.COMPRESSION_ERROR, "uncompress: inflate returned " + status); } } }
int resultCode = z.inflate(JZlib.Z_SYNC_FLUSH); int outputLength = z.next_out_index - oldNextOutIndex; if (outputLength > 0) {
if(inflater.avail_in==0) fill(); int err = inflater.inflate(JZlib.Z_NO_FLUSH); n += inflater.next_out_index - off; off = inflater.next_out_index;
int resultCode = z.inflate(JZlib.Z_SYNC_FLUSH); int outputLength = z.next_out_index - oldNextOutIndex; if (outputLength > 0) {
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 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 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()); }
if(inflater.avail_in==0) fill(); int err = inflater.inflate(JZlib.Z_NO_FLUSH); n += inflater.next_out_index - off; off = inflater.next_out_index;
if(inflater.avail_in==0) fill(); int err = inflater.inflate(JZlib.Z_NO_FLUSH); n += inflater.next_out_index - off; off = inflater.next_out_index;
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; } }
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; } }
int err = inflater.inflate(JZlib.Z_NO_FLUSH);
int err = inflater.inflate(JZlib.Z_NO_FLUSH);
int err = inflater.inflate(JZlib.Z_NO_FLUSH);
int ret = flater.inflate(com.jcraft.jzlib.JZlib.Z_NO_FLUSH); resultLength = flater.next_out_index - collectedIdx; collectedIdx = flater.next_out_index; int err = flater.inflate(com.jcraft.jzlib.JZlib.Z_FINISH); if (err != com.jcraft.jzlib.JZlib.Z_OK) { throw RubyZlib.newBufError(getRuntime(), "buffer error");
int ret = flater.inflate(com.jcraft.jzlib.JZlib.Z_NO_FLUSH); resultLength = flater.next_out_index - collectedIdx; collectedIdx = flater.next_out_index; int err = flater.inflate(com.jcraft.jzlib.JZlib.Z_FINISH); if (err != com.jcraft.jzlib.JZlib.Z_OK) { throw RubyZlib.newBufError(getRuntime(), "buffer error");
@Override public void uncompress(Buffer from, Buffer to) throws TransportException { inflater.setNextIn(from.array()); inflater.setNextInIndex(from.rpos()); inflater.setAvailIn(from.available()); while (true) { inflater.setNextOut(tempBuf); inflater.setNextOutIndex(0); inflater.setAvailOut(BUF_SIZE); final int status = inflater.inflate(JZlib.Z_PARTIAL_FLUSH); switch (status) { case JZlib.Z_OK: to.putRawBytes(tempBuf, 0, BUF_SIZE - inflater.getAvailOut()); break; case JZlib.Z_BUF_ERROR: return; default: throw new TransportException(DisconnectReason.COMPRESSION_ERROR, "uncompress: inflate returned " + status); } } }