- All Implemented Interfaces:
Serializable,Comparable<NBTCompression>,Constable
This enum contains all supported compression schemes for NBT files
- Author:
- SyntaxError404
-
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 NBTCompressiongetCompressionFromId(byte id) Converts anIDinto its corresponding compression schemebytegetId()Returns the id of this compression schemenewInputStream(InputStream stream) Wraps an input stream around the corresponding compressor streamnewOutputStream(OutputStream stream) Wraps an output stream around the corresponding decompressor streamstatic NBTCompressionReturns the enum constant of this class with the specified name.static NBTCompression[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
GZIP
compress NBT using gzip -
ZLIB
compress NBT using zlib -
NONE
do not compress NBT
-
-
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
-
getCompressionFromId
Converts anIDinto its corresponding compression scheme- Parameters:
id- an ID- Returns:
- the corresponding scheme
-
newOutputStream
Wraps an output stream around the corresponding decompressor stream- Parameters:
stream- stream to be decompressed- Returns:
- the decompressed stream
- Throws:
IOException- if an I/O error occured
-
newInputStream
Wraps an input stream around the corresponding compressor stream- Parameters:
stream- stream to be compressed- Returns:
- the compressed stream
- Throws:
IOException- if an I/O error occured
-
getId
public byte getId()Returns the id of this compression scheme- Returns:
- the id of this compression scheme
-