org.crosswire.common.compress
Interface Compressor

All Known Implementing Classes:
AbstractCompressor, LZSS, Zip

public interface Compressor

A compressor provides the ability to compress and uncompress block text. Implementing classes are expected to provide a way to supply the input.

Author:
DM Smith
See Also:
for license details.
The copyright to this program is held by it's authors.

Field Summary
static int BUF_SIZE
          The size to read/write when unzipping a compressed byte array of unknown size.
 
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.
 

Field Detail

BUF_SIZE

static final int BUF_SIZE
The size to read/write when unzipping a compressed byte array of unknown size.

See Also:
Constant Field Values
Method Detail

compress

ByteArrayOutputStream compress()
                               throws IOException
Compresses the input and provides the result.

Returns:
the compressed result
Throws:
IOException

uncompress

ByteArrayOutputStream uncompress()
                                 throws IOException
Uncompresses the input and provides the result.

Returns:
the uncompressed result
Throws:
IOException

uncompress

ByteArrayOutputStream uncompress(int expectedLength)
                                 throws IOException
Uncompresses the input and provides the result.

Parameters:
expectedLength - the size of the result buffer
Returns:
the uncompressed result
Throws:
IOException

Copyright ? 2003-2011