Package com.mysql.cj.protocol.x
Class CompressorStreamsFactory
java.lang.Object
com.mysql.cj.protocol.x.CompressorStreamsFactory
public class CompressorStreamsFactory
extends java.lang.Object
Factory class for producing inflating and deflating-able
InputStream
and OutputStream
instances for a selected compression algorithm.-
Constructor Summary
Constructors Constructor Description CompressorStreamsFactory(CompressionAlgorithm algorithm)
-
Method Summary
Modifier and Type Method Description boolean
areCompressedStreamsReusable()
CompressionMode
getCompressionMode()
java.io.InputStream
getInputStreamInstance(java.io.InputStream in)
Creates an instance of anInputStream
that wraps around the givenInputStream
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 anOutputStream
that wraps around the givenOutputStream
and knows how to deflate data using the algorithm given in this class' constructor.
-
Constructor Details
-
Method Details
-
getCompressionMode
-
areCompressedStreamsReusable
public boolean areCompressedStreamsReusable() -
getInputStreamInstance
public java.io.InputStream getInputStreamInstance(java.io.InputStream in)Creates an instance of anInputStream
that wraps around the givenInputStream
and knows how to inflate data using the algorithm given in this class' constructor.- Parameters:
in
- theInputStream
to use as source of the bytes to inflate.- Returns:
- the new inflater
InputStream
wrapper instance.
-
getOutputStreamInstance
public java.io.OutputStream getOutputStreamInstance(java.io.OutputStream out)Creates an instance of anOutputStream
that wraps around the givenOutputStream
and knows how to deflate data using the algorithm given in this class' constructor.- Parameters:
out
- theOutputStream
to use as target of the bytes to deflate.- Returns:
- the new deflater
OutputStream
wrapper instance.
-