Enum CompressionLevel

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<CompressionLevel>

    public enum CompressionLevel
    extends java.lang.Enum<CompressionLevel>
    Indicates the level of compression for the DEFLATE compression method
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      FAST
      Level 3 Deflate compression
      FASTER
      Level 2 Deflate compression
      FASTEST
      Level 1 Deflate compression.
      HIGHER
      Level 6 Deflate compression
      MAXIMUM
      Level 7 Deflate compression
      MEDIUM_FAST
      Level 4 Deflate compression
      NO_COMPRESSION
      Level 0 - No compression
      NORMAL
      Level 5 Deflate compression.
      PRE_ULTRA
      Level 8 Deflate compression
      ULTRA
      Level 9 Deflate compression.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int level  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private CompressionLevel​(int level)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getLevel()
      Get the Deflate compression level (0-9) for this CompressionLevel
      static CompressionLevel valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static CompressionLevel[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • NO_COMPRESSION

        public static final CompressionLevel NO_COMPRESSION
        Level 0 - No compression
      • FASTEST

        public static final CompressionLevel FASTEST
        Level 1 Deflate compression. Fastest compression.
      • FASTER

        public static final CompressionLevel FASTER
        Level 2 Deflate compression
      • MEDIUM_FAST

        public static final CompressionLevel MEDIUM_FAST
        Level 4 Deflate compression
      • NORMAL

        public static final CompressionLevel NORMAL
        Level 5 Deflate compression. A compromise between speed and compression level.
      • HIGHER

        public static final CompressionLevel HIGHER
        Level 6 Deflate compression
      • MAXIMUM

        public static final CompressionLevel MAXIMUM
        Level 7 Deflate compression
      • PRE_ULTRA

        public static final CompressionLevel PRE_ULTRA
        Level 8 Deflate compression
      • ULTRA

        public static final CompressionLevel ULTRA
        Level 9 Deflate compression. Highest compression.
    • Field Detail

      • level

        private final int level
    • Constructor Detail

      • CompressionLevel

        private CompressionLevel​(int level)
    • Method Detail

      • values

        public static CompressionLevel[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (CompressionLevel c : CompressionLevel.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static CompressionLevel valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getLevel

        public int getLevel()
        Get the Deflate compression level (0-9) for this CompressionLevel
        Returns:
        the deflate compression level