Enum Class Compression
- All Implemented Interfaces:
Serializable
,Comparable<Compression>
,Constable
An enumeration of file compression types.
- Since:
- 10.3
- Version:
- 10.6
- Author:
- Luke
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic Compression
Detects the compression format of a File.static Compression
Returns the compression type for a given file name.getStream
(InputStream is) Returns a compressed input stream for a particular compression type.static Compression
Returns the enum constant of this class with the specified name.static Compression[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NONE
-
GZIP
-
BZIP2
-
BROTLI
-
XZ
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException
- if the argument is null
-
get
Returns the compression type for a given file name.- Parameters:
fileName
- the file name- Returns:
- a CompressionType
-
getStream
Returns a compressed input stream for a particular compression type.- Parameters:
is
- the raw InputStream- Returns:
- a decompressor InputStream for this compression type
- Throws:
IOException
- if an I/O error occurs
-
detect
Detects the compression format of a File. Note that there is no standardized magic number for Brotli compressed streams.- Parameters:
f
- a File- Returns:
- a Compression type
- Throws:
IOException
- if an I/O error occurs
-