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

public Class CompressionAlgorithm

extends Object
Class Inheritance
Imports
java.io.InputStream, .OutputStream, java.util.HashMap, .Map, java.util.zip.InflaterInputStream, com.mysql.cj.Messages, com.mysql.cj.exceptions.ExceptionFactory, .WrongArgumentException

Contains all information about a compression algorithm, its name, compression mode and classes that implement the inflating and deflating streams of data.

Field Summary

Modifier and TypeField and Description
private String
private static final Map<String, String>
private CompressionMode
private String
private String

Constructor Summary

AccessConstructor and Description
public
CompressionAlgorithm(String name, String inputStreamClassFqn, String outputStreamClassFqn)

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

an algorithm identifier.
getAlgorithmIdentifier
()

Gets this algorithm's identifier.

public CompressionMode

Returns:

an algorithm CompressionMode
getCompressionMode
()

Gets this algorithm's compression mode.

public static Map<String, CompressionAlgorithm>

Returns:

a list of the compression algorithms supported natively.
getDefaultInstances
()

Returns a list of the compression algorithms supported natively.

public String

Returns:

an InputStream that knows how to inflate data.
getInputStreamClassName
()

Gets this algorithm's InputStream implementation class name that can be used to inflate data.

public static String

Returns:

if name is an already normalized identifier or an unknown alias then the returned value is the same as the input, otherwise the normalized algorithm identifier is returned.
getNormalizedAlgorithmName
(String
the non-normalized compression algorithm identifier.
name
)

Returns the normalized compression algorithm identifier.

public String

Returns:

an OutputStream that knows how to deflate data.
getOutputStreamClassName
()

Gets this algorithm's OutputStream implementation class name that can be used to deflate data.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

algorithmIdentifierback to summary
private String algorithmIdentifier
ALIASESback to summary
private static final Map<String, String> ALIASES
compressionModeback to summary
private CompressionMode compressionMode
inputStreamClassFqnback to summary
private String inputStreamClassFqn
outputStreamClassFqnback to summary
private String outputStreamClassFqn

Constructor Detail

CompressionAlgorithmback to summary
public CompressionAlgorithm(String name, String inputStreamClassFqn, String outputStreamClassFqn)

Method Detail

getAlgorithmIdentifierback to summary
public String getAlgorithmIdentifier()

Gets this algorithm's identifier.

Returns:String

an algorithm identifier.

getCompressionModeback to summary
public CompressionMode getCompressionMode()

Gets this algorithm's compression mode.

Returns:CompressionMode

an algorithm CompressionMode

getDefaultInstancesback to summary
public static Map<String, CompressionAlgorithm> getDefaultInstances()

Returns a list of the compression algorithms supported natively. Additional algorithms can be registered by user.

Returns:Map<String, CompressionAlgorithm>

a list of the compression algorithms supported natively.

getInputStreamClassNameback to summary
public String getInputStreamClassName()

Gets this algorithm's InputStream implementation class name that can be used to inflate data.

Returns:String

an InputStream that knows how to inflate data.

getNormalizedAlgorithmNameback to summary
public static String getNormalizedAlgorithmName(String name)

Returns the normalized compression algorithm identifier. A normalized identifier is composed by a compression algorithm name followed by '_' and then the the compression operation mode ("stream" vs "message").

Parameters
name:String

the non-normalized compression algorithm identifier.

Returns:String

if name is an already normalized identifier or an unknown alias then the returned value is the same as the input, otherwise the normalized algorithm identifier is returned.

getOutputStreamClassNameback to summary
public String getOutputStreamClassName()

Gets this algorithm's OutputStream implementation class name that can be used to deflate data.

Returns:String

an OutputStream that knows how to deflate data.