public class BZip2InputStream extends InputStream
InputStream for reading bzip2 encoded data.
For more information on the inner workings of bzip2, see the Wikipedia article on bzip2.
This stream is not safe for concurrent access by several writing threads. A client must provide external synchronization to use this from several threads.
BZip2InputStreamSettings,
BZip2OutputStream| Constructor and Description |
|---|
BZip2InputStream(InputStream in)
Create a new bzip2 input stream that will read compressed data from
in. |
BZip2InputStream(InputStream in,
BZip2InputStreamSettings settings)
Create a new bzip2 input stream that will read compressed data from
in. |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected void |
finalize()
Close the stream if the client has been sloppy about it.
|
int |
read() |
int |
read(byte[] barr) |
int |
read(byte[] barr,
int off,
int len) |
available, mark, markSupported, reset, skippublic BZip2InputStream(InputStream in) throws IOException
in.in - The stream to read compressed data from.IOException - On errors when reading the file header.BZip2InputStream(InputStream, BZip2InputStreamSettings)public BZip2InputStream(InputStream in, BZip2InputStreamSettings settings) throws IOException
in.in - The stream to read compressed data from.settings - Settings for the decoder.IOException - On errors when reading the file header.BZip2InputStream(InputStream)public int read()
throws IOException
read in class InputStreamIOExceptionpublic int read(byte[] barr)
throws IOException
read in class InputStreamIOExceptionpublic int read(byte[] barr,
int off,
int len)
throws IOException,
IndexOutOfBoundsException
read in class InputStreamIOExceptionIndexOutOfBoundsExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class InputStreamIOException