public class ZLIBCompressionInputStream extends java.lang.Object implements InputStreamCompressEngine
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.
COMPRESS, DECOMPRESS| Constructor and Description |
|---|
ZLIBCompressionInputStream(java.io.InputStream inputstream,
int CompressMode,
int blocksize)
Wrap the given inputstream with the ZLIBCompressionInputStream given the CompressMode
(InputStreamCompressEngine.COMPRESS) or (InputStreamCompressEngine.DECOMPRESS)
as well as the blocksize.
|
| Modifier and Type | Method and Description |
|---|---|
java.io.InputStream |
getInputStream()
This method returns the ZLIBCompressionInputStream
|
public ZLIBCompressionInputStream(java.io.InputStream inputstream,
int CompressMode,
int blocksize)
inputstream - the inputstream to be wrappedCompressMode - the compression mode, one of InputStreamCompressEngine.COMPRESS or
InputStreamCompressEngine.DECOMPRESSblocksize - the blocksize used for processing the inputstream.public java.io.InputStream getInputStream()
getInputStream in interface InputStreamCompressEngine