Class CBZip2InputStream
- All Implemented Interfaces:
- Closeable,- AutoCloseable,- BZip2Constants
The decompression requires large amounts of memory. Thus you
 should call the close() method as soon as
 possible, to force CBZip2InputStream to release the
 allocated memory.  See CBZip2OutputStream for information about memory usage.
CBZip2InputStream reads bytes from the compressed
 source stream via the single byte read() method exclusively. Thus you should consider to use a
 buffered source stream.
Instances of this class are not threadsafe.
- 
Field SummaryFields inherited from interface org.apache.tools.bzip2.BZip2ConstantsbaseBlockSize, G_SIZE, MAX_ALPHA_SIZE, MAX_CODE_LEN, MAX_SELECTORS, N_GROUPS, N_ITERS, NUM_OVERSHOOT_BYTES, rNums, RUNA, RUNB
- 
Constructor SummaryConstructorsConstructorDescriptionConstructs a new CBZip2InputStream which decompresses bytes read from the specified stream.CBZip2InputStream(InputStream in, boolean decompressConcatenated) Constructs a new CBZip2InputStream which decompresses bytes read from the specified stream.
- 
Method SummaryMethods inherited from class java.io.InputStreamavailable, mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
- 
Constructor Details- 
CBZip2InputStreamConstructs a new CBZip2InputStream which decompresses bytes read from the specified stream. This doesn't support decompressing concatenated .bz2 files.Although BZip2 headers are marked with the magic "Bz"this constructor expects the next byte in the stream to be the first one after the magic. Thus callers have to skip the first two bytes. Otherwise this constructor will throw an exception.- Parameters:
- in- InputStream
- Throws:
- IOException- if the stream content is malformed or an I/O error occurs.
- NullPointerException- if- in == null
 
- 
CBZip2InputStreamConstructs a new CBZip2InputStream which decompresses bytes read from the specified stream.Although BZip2 headers are marked with the magic "Bz"this constructor expects the next byte in the stream to be the first one after the magic. Thus callers have to skip the first two bytes. Otherwise this constructor will throw an exception.- Parameters:
- in- the InputStream from which this object should be created
- decompressConcatenated- if true, decompress until the end of the input; if false, stop after the first .bz2 stream and leave the input position to point to the next byte after the .bz2 stream
- Throws:
- IOException- if the stream content is malformed or an I/O error occurs.
- NullPointerException- if- in == null
 
 
- 
- 
Method Details- 
read- Specified by:
- readin class- InputStream
- Throws:
- IOException
 
- 
read- Overrides:
- readin class- InputStream
- Throws:
- IOException
 
- 
close- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
- Overrides:
- closein class- InputStream
- Throws:
- IOException
 
 
-