Module syntaxnbt

Enum Class NBTCompression

java.lang.Object
java.lang.Enum<NBTCompression>
at.syntaxerror.syntaxnbt.NBTCompression
All Implemented Interfaces:
Serializable, Comparable<NBTCompression>, Constable

public enum NBTCompression extends Enum<NBTCompression>
This enum contains all supported compression schemes for NBT files
Author:
SyntaxError404
  • Enum Constant Details

    • GZIP

      public static final NBTCompression GZIP
      compress NBT using gzip
    • ZLIB

      public static final NBTCompression ZLIB
      compress NBT using zlib
    • NONE

      public static final NBTCompression NONE
      do not compress NBT
  • Method Details

    • values

      public static NBTCompression[] 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

      public static NBTCompression valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • getCompressionFromId

      public static NBTCompression getCompressionFromId(byte id)
      Converts an ID into its corresponding compression scheme
      Parameters:
      id - an ID
      Returns:
      the corresponding scheme
    • newOutputStream

      public OutputStream newOutputStream(OutputStream stream) throws IOException
      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

      public InputStream newInputStream(InputStream stream) throws IOException
      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