Enum CompressionLevel

java.lang.Object
java.lang.Enum<CompressionLevel>
net.lingala.zip4j.model.enums.CompressionLevel
All Implemented Interfaces:
Serializable, Comparable<CompressionLevel>

public enum CompressionLevel extends Enum<CompressionLevel>
Indicates the level of compression for the DEFLATE compression method
  • Enum Constant Details

    • 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
    • FAST

      public static final CompressionLevel FAST
      Level 3 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 Details

    • level

      private final int level
  • Constructor Details

    • CompressionLevel

      private CompressionLevel(int level)
  • Method Details

    • values

      public static CompressionLevel[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static CompressionLevel valueOf(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:
      IllegalArgumentException - if this enum type has no constant with the specified name
      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