org.crosswire.common.compress
Class Zip

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

public class Zip
extends AbstractCompressor

Zip manages the compression and uncompression of Zip files.

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

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
Zip(InputStream input)
          Create a Zip 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

Zip

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

uncompress

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

Returns:
the uncompressed result
Throws:
IOException

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

Copyright ? 2003-2011