Underlying decoder in use.
Object that handles details of buffer recycling
stream to be decompressed
Flag that indicates if we have already called 'inputStream.close()'
(to avoid calling it multiple times)
Flag that indicates whether we force full reads (reading of as many
bytes as requested), or 'optimal' reads (up to as many as available,
but at least one). Default is false, meaning that 'optimal' read
the current buffer of compressed bytes (from which to decode)
the buffer of uncompressed bytes from which content is read
The current position (next char to output) in the uncompressed bytes buffer.
Length of the current uncompressed bytes buffer
this(decoder, in, false);
in Underlying input stream to use
should try to read exactly
as many bytes as requested (true); or just however many happen to be
Method that can be used define whether reads should be "full" or
"optimal": former means that full compressed blocks are read right
away as needed, optimal that only smaller chunks are read at a time,
more being read as needed.
Method is overridden to report number of bytes that can now be read
from decoded data buffer, without reading bytes from the underlying
Never throws an exception; returns number of bytes available without
further reads from underlying source; -1 if stream has been closed, or
0 if an actual read (and possible blocking) is needed to find out.
return (left <= 0) ? 0 : left;
return read(buffer, 0, buffer.length);
public int read(final byte buffer, int offset, int length) throws IOException
int totalRead = chunkLength;
totalRead += chunkLength;
} while (totalRead < length);
Overridden to implement efficient skipping by skipping full chunks whenever
Method that can be used to find underlying
we read from to get LZF encoded data to decode.
Will never return null; although underlying stream may be closed
(if this stream has been closed).
Method that can be called to discard any already buffered input, read
from input source.
Specialized method that only makes sense if the underlying
can be repositioned reliably.
Convenience method that will read and uncompress all data available,
and write it using given
. This avoids having to
make an intermediate copy of uncompressed data which would be needed
when doing the same manually.
out OutputStream to use for writing content
- Number of bytes written (uncompressed)
Fill the uncompressed bytes buffer by reading the underlying inputStream.
- True if there is now at least one byte to read in the buffer; false
if there is no more content to read