org.crosswire.common.compress
Class XZ

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

public class XZ
extends AbstractCompressor

XZ manages the compression and uncompression of XZ 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
XZ(InputStream input)
          Create a GZip 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

XZ

public XZ(InputStream input)
Create a GZip 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