/** * Fill the uncompressed bytes buffer by reading the underlying inputStream. * * @throws IOException * * @return True if there is now at least one byte to read in the buffer; false * if there is no more content to read */ protected boolean readyBuffer() throws IOException { if (_bufferPosition < _bufferLength) { return true; } if (_inputStreamClosed) { return false; } _bufferLength = _decoder.decodeChunk(_inputStream, _inputBuffer, _decodedBytes); if (_bufferLength < 0) { close(); return false; } _bufferPosition = 0; return (_bufferPosition < _bufferLength); } }
/** * Fill the uncompressed bytes buffer by reading the underlying inputStream. * * @throws IOException * * @return True if there is now at least one byte to read in the buffer; false * if there is no more content to read */ protected boolean readyBuffer() throws IOException { if (_bufferPosition < _bufferLength) { return true; } if (_inputStreamClosed) { return false; } _bufferLength = _decoder.decodeChunk(_inputStream, _inputBuffer, _decodedBytes); if (_bufferLength < 0) { close(); return false; } _bufferPosition = 0; return (_bufferPosition < _bufferLength); } }
/** * Fill the uncompressed bytes buffer by reading the underlying inputStream. * * @throws IOException * * @return True if there is now at least one byte to read in the buffer; false * if there is no more content to read */ protected boolean readyBuffer() throws IOException { if (_bufferPosition < _bufferLength) { return true; } if (_inputStreamClosed) { return false; } _bufferLength = _decoder.decodeChunk(_inputStream, _inputBuffer, _decodedBytes); if (_bufferLength < 0) { close(); return false; } _bufferPosition = 0; return (_bufferPosition < _bufferLength); } }
close(); return skipped;
close(); return skipped;
close(); return skipped;
public static void decompress(InputStream in, OutputStream out) throws IOException { LZFInputStream decompressor = null; try { decompressor = new LZFInputStream(in); byte[] buf = ThreadLocalByteBuffer.getBuffer(); int len; while ((len = decompressor.read(buf)) != -1) { out.write(buf, 0, len); } } finally { if (decompressor != null) { decompressor.close(); } } }