org.crosswire.common.compress
Class BZip2

java.lang.Object
  extended by org.crosswire.common.compress.AbstractCompressor
      extended by org.crosswire.common.compress.BZip2
All Implemented Interfaces:
Compressor

public class BZip2
extends AbstractCompressor

BZip2 manages the compression and uncompression of BZip2 data.

Author:
DM Smith
See Also:
The GNU Lesser General Public License for details.

Field Summary
 
Fields inherited from class org.crosswire.common.compress.AbstractCompressor
input
 
Fields inherited from interface org.crosswire.common.compress.Compressor
BUF_SIZE
 
Constructor Summary
BZip2(InputStream input)
          Create a BZip2 that is capable of transforming the input.
 
Method Summary
 ByteArrayOutputStream compress()
          Compresses the input and provides the result.
 ByteArrayOutputStream uncompress()
          Uncompresses the input and provides the result.
 ByteArrayOutputStream uncompress(int expectedLength)
          Uncompresses the input and provides the result.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BZip2

public BZip2(InputStream input)
Create a BZip2 that is capable of transforming the input.

Parameters:
input - to compress or uncompress.
Method Detail

compress

public ByteArrayOutputStream compress()
                               throws IOException
Description copied from interface: Compressor
Compresses the input and provides the result.

Returns:
the compressed result
Throws:
IOException - if an exception is encountered

uncompress

public ByteArrayOutputStream uncompress()
                                 throws IOException
Description copied from interface: Compressor
Uncompresses the input and provides the result.

Returns:
the uncompressed result
Throws:
IOException - if an exception is encountered

uncompress

public ByteArrayOutputStream uncompress(int expectedLength)
                                 throws IOException
Description copied from interface: Compressor
Uncompresses the input and provides the result.

Parameters:
expectedLength - the size of the result buffer
Returns:
the uncompressed result
Throws:
IOException - if an exception is encountered

Copyright ยจ 2003-2015