Class CompressionAlgorithm

java.lang.Object
com.mysql.cj.protocol.x.CompressionAlgorithm

public class CompressionAlgorithm
extends java.lang.Object
Contains all information about a compression algorithm, its name, compression mode and classes that implement the inflating and deflating streams of data.
  • Constructor Summary

    Constructors 
    Constructor Description
    CompressionAlgorithm​(java.lang.String name, java.lang.String inputStreamClassFqn, java.lang.String outputStreamClassFqn)  
  • Method Summary

    Modifier and Type Method Description
    java.lang.String getAlgorithmIdentifier()
    Gets this algorithm's identifier.
    CompressionMode getCompressionMode()
    Gets this algorithm's compression mode.
    static java.util.Map<java.lang.String,​CompressionAlgorithm> getDefaultInstances()
    Returns a list of the compression algorithms supported natively.
    java.lang.Class<?> getInputStreamClass()
    Gets this algorithm's InputStream implementation class that can be used to inflate data.
    static java.lang.String getNormalizedAlgorithmName​(java.lang.String name)
    Returns the normalized compression algorithm identifier.
    java.lang.Class<?> getOutputStreamClass()
    Gets this algorithm's OutputStream implementation class that can be used to deflate data.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CompressionAlgorithm

      public CompressionAlgorithm​(java.lang.String name, java.lang.String inputStreamClassFqn, java.lang.String outputStreamClassFqn)
  • Method Details

    • getDefaultInstances

      public static java.util.Map<java.lang.String,​CompressionAlgorithm> getDefaultInstances()
      Returns a list of the compression algorithms supported natively. Additional algorithms can be registered by user.
      Returns:
      a list of the compression algorithms supported natively.
    • getNormalizedAlgorithmName

      public static java.lang.String getNormalizedAlgorithmName​(java.lang.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 - the non-normalized compression algorithm identifier.
      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.
    • getAlgorithmIdentifier

      public java.lang.String getAlgorithmIdentifier()
      Gets this algorithm's identifier.
      Returns:
      an algorithm identifier.
    • getCompressionMode

      public CompressionMode getCompressionMode()
      Gets this algorithm's compression mode.
      Returns:
      an algorithm CompressionMode
    • getInputStreamClass

      public java.lang.Class<?> getInputStreamClass()
      Gets this algorithm's InputStream implementation class that can be used to inflate data.
      Returns:
      an InputStream that knows how to inflate data.
    • getOutputStreamClass

      public java.lang.Class<?> getOutputStreamClass()
      Gets this algorithm's OutputStream implementation class that can be used to deflate data.
      Returns:
      an OutputStream that knows how to deflate data.