@Override public int read() throws IOException { if (!readyBuffer()) { return -1; } return _decodedBytes[_bufferPosition++] & 255; }
@Override public int read() throws IOException { if (!readyBuffer()) { return -1; } return _decodedBytes[_bufferPosition++] & 255; }
@Override public int read() throws IOException { if (!readyBuffer()) { return -1; } return _decodedBytes[_bufferPosition++] & 255; }
/** * Convenience method that will read and uncompress all data available, * and write it using given {@link OutputStream}. This avoids having to * make an intermediate copy of uncompressed data which would be needed * when doing the same manually. * * @param out OutputStream to use for writing content * * @return Number of bytes written (uncompressed) */ public int readAndWrite(OutputStream out) throws IOException { int total = 0; while (readyBuffer()) { int avail = _bufferLength - _bufferPosition; out.write(_decodedBytes, _bufferPosition, avail); _bufferPosition += avail; // to ensure it looks like we consumed it all total += avail; } return total; }
/** * Convenience method that will read and uncompress all data available, * and write it using given {@link OutputStream}. This avoids having to * make an intermediate copy of uncompressed data which would be needed * when doing the same manually. * * @param out OutputStream to use for writing content * * @return Number of bytes written (uncompressed) */ public int readAndWrite(OutputStream out) throws IOException { int total = 0; while (readyBuffer()) { int avail = _bufferLength - _bufferPosition; out.write(_decodedBytes, _bufferPosition, avail); _bufferPosition += avail; // to ensure it looks like we consumed it all total += avail; } return total; }
/** * Convenience method that will read and uncompress all data available, * and write it using given {@link OutputStream}. This avoids having to * make an intermediate copy of uncompressed data which would be needed * when doing the same manually. * * @param out OutputStream to use for writing content * * @return Number of bytes written (uncompressed) */ public int readAndWrite(OutputStream out) throws IOException { int total = 0; while (readyBuffer()) { int avail = _bufferLength - _bufferPosition; out.write(_decodedBytes, _bufferPosition, avail); _bufferPosition += avail; // to ensure it looks like we consumed it all total += avail; } return total; }
return 0; if (!readyBuffer()) { return -1; do { offset += chunkLength; if (!readyBuffer()) { break;
return 0; if (!readyBuffer()) { return -1; do { offset += chunkLength; if (!readyBuffer()) { break;
return 0; if (!readyBuffer()) { return -1; do { offset += chunkLength; if (!readyBuffer()) { break;