public class CompressorStreamsFactory
extends java.lang.Object
InputStream
and OutputStream
instances for a selected compression algorithm.Constructor and Description |
---|
CompressorStreamsFactory(CompressionAlgorithm algorithm) |
Modifier and Type | Method and Description |
---|---|
boolean |
areCompressedStreamsContinuous() |
CompressionMode |
getCompressionMode() |
java.io.InputStream |
getInputStreamInstance(java.io.InputStream in)
Creates an instance of an
InputStream that wraps around the given InputStream and knows how to inflate data using the algorithm given in
this class' constructor. |
java.io.OutputStream |
getOutputStreamInstance(java.io.OutputStream out)
Creates an instance of an
OutputStream that wraps around the given OutputStream and knows how to deflate data using the algorithm given
in this class' constructor. |
public CompressorStreamsFactory(CompressionAlgorithm algorithm)
public CompressionMode getCompressionMode()
public boolean areCompressedStreamsContinuous()
public java.io.InputStream getInputStreamInstance(java.io.InputStream in)
InputStream
that wraps around the given InputStream
and knows how to inflate data using the algorithm given in
this class' constructor.
If the compression algorithm operates in steam mode (continuous) then create and reuse one single instance of the compressor InputStream
, else
create a new instance every time.in
- the InputStream
to use as source of the bytes to inflate.InputStream
wrapper instance.public java.io.OutputStream getOutputStreamInstance(java.io.OutputStream out)
OutputStream
that wraps around the given OutputStream
and knows how to deflate data using the algorithm given
in this class' constructor.
If the compression algorithm operates in steam mode (continuous) then create and reuse one single instance of the compressor OutputStream
, else
create a new instance every time.out
- the OutputStream
to use as target of the bytes to deflate.OutputStream
wrapper instance.