public class BZip2BlockCompressor extends Object
| Constructor and Description |
|---|
BZip2BlockCompressor(BZip2BitOutputStream bitOutputStream,
int blockSize) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Compresses and writes out the block
|
int |
getCRC()
Gets the CRC of the completed block.
|
boolean |
isEmpty()
Determines if any bytes have been written to the block
|
int |
write(byte[] data,
int offset,
int length)
Writes an array to the block
|
boolean |
write(int value)
Writes a byte to the block, accumulating to an RLE run where possible
|
public BZip2BlockCompressor(BZip2BitOutputStream bitOutputStream, int blockSize)
bitOutputStream - The BZip2BitOutputStream to which compressed BZip2 data is writtenblockSize - The declared block size in bytes. Up to this many bytes will be accepted
into the block after Run-Length Encoding is appliedpublic boolean write(int value)
value - The byte to writetrue if the byte was written, or false if the block is already fullpublic int write(byte[] data,
int offset,
int length)
data - The array to writeoffset - The offset within the input data to write fromlength - The number of bytes of input data to writepublic void close()
throws IOException
IOException - on any I/O error writing the datapublic boolean isEmpty()
true if one or more bytes has been written to the block, otherwise
falsepublic int getCRC()
close()Copyright © 2015. All rights reserved.