Top Description Fields Constructors Methods
com.mysql.cj.protocol.x

public Class CompressorStreamsFactory

extends Object
Class Inheritance
Imports
java.io.InputStream, .OutputStream, com.mysql.cj.Messages, com.mysql.cj.exceptions.CJException, .ExceptionFactory, .WrongArgumentException, com.mysql.cj.util.Util

Factory class for producing inflating and deflating-able InputStream and OutputStream instances for a selected compression algorithm.

Field Summary

Modifier and TypeField and Description
private CompressionAlgorithm
private InputStream
private OutputStream
private ContinuousInputStream
private ReusableOutputStream

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
public CompressionMode
public InputStream

Returns:

the new inflater InputStream wrapper instance.
getInputStreamInstance
(InputStream
the InputStream to use as source of the bytes to inflate.
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.

public OutputStream

Returns:

the new deflater OutputStream wrapper instance.
getOutputStreamInstance
(OutputStream
the OutputStream to use as target of the bytes to deflate.
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.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

compressionAlgorithmback to summary
private CompressionAlgorithm compressionAlgorithm
compressorInputStreamInstanceback to summary
private InputStream compressorInputStreamInstance
compressorOutputStreamInstanceback to summary
private OutputStream compressorOutputStreamInstance
underlyingInputStreamback to summary
private ContinuousInputStream underlyingInputStream
underlyingOutputStreamback to summary
private ReusableOutputStream underlyingOutputStream

Constructor Detail

CompressorStreamsFactoryback to summary
public CompressorStreamsFactory(CompressionAlgorithm algorithm)

Method Detail

areCompressedStreamsContinuousback to summary
public boolean areCompressedStreamsContinuous()
getCompressionModeback to summary
public CompressionMode getCompressionMode()
getInputStreamInstanceback to summary
public InputStream getInputStreamInstance(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. 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.

Parameters
in:InputStream

the InputStream to use as source of the bytes to inflate.

Returns:InputStream

the new inflater InputStream wrapper instance.

getOutputStreamInstanceback to summary
public OutputStream getOutputStreamInstance(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. 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.

Parameters
out:OutputStream

the OutputStream to use as target of the bytes to deflate.

Returns:OutputStream

the new deflater OutputStream wrapper instance.