public interface InputStreamCompressEngine
Implementors can choose to compress the supplied data with any type of compression algorithm by the following means:
1. Extend the CompressionProvider class, and override method getInputStreamCompressEngine,
which is specified as follows:
if(algorithmid.equals(CompressionProvider.zlib_compress))
return new ZLIBCompressionInputStream(inputstream, CompressMode, blocksize);
else
throw new NoSuchAlgorithmException("Algorithm " + algorithmid.getAlgorithm().getName() + " not available!");
2. Specify the AlgorithmID for the compression algorithm being used. This AlgorithmID
should be added into the extension of the CompressionProvider as CompressionProvider is
an extension of AlgorithmID.
3. Write a Compression InputStream class which implements interface
InputStreamCompressEngine and make sure the getInputStream() method is
implemented.
| Modifier and Type | Field and Description |
|---|---|
static int |
COMPRESS
Indicates that the InputSTream returned will be compressed
|
static int |
DECOMPRESS
Indicates that the InputStream returned will be decompressed
|
| Modifier and Type | Method and Description |
|---|---|
java.io.InputStream |
getInputStream() |
static final int DECOMPRESS
static final int COMPRESS