public class BZip2OutputStream extends OutputStream
An OutputStream wrapper that compresses BZip2 data
Instances of this class are not threadsafe.
Constructor and Description |
---|
BZip2OutputStream(OutputStream outputStream)
Constructs a BZip2 stream compressor with the maximum (900,000 byte) block size
|
BZip2OutputStream(OutputStream outputStream,
int blockSizeMultiplier) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
finish()
Compresses and writes out any as yet unwritten data, then writes the end of the BZip2 stream.
|
void |
write(byte[] data,
int offset,
int length) |
void |
write(int value) |
flush, write
public BZip2OutputStream(OutputStream outputStream, int blockSizeMultiplier) throws IOException
outputStream
- The output stream to write toblockSizeMultiplier
- The BZip2 block size as a multiple of 100,000 bytes (minimum 1,
maximum 9). Larger block sizes require more memory for both compression and decompression,
but give better compression ratios. 9
will usually be the best value to useIOException
- on any I/O error writing to the output streampublic BZip2OutputStream(OutputStream outputStream) throws IOException
outputStream
- The output stream to write toIOException
- on any I/O error writing to the output streampublic void write(int value) throws IOException
write
in class OutputStream
IOException
public void write(byte[] data, int offset, int length) throws IOException
write
in class OutputStream
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class OutputStream
IOException
public void finish() throws IOException
IOException
- on any I/O error writing to the output streamCopyright © 2017. All rights reserved.