Package com.kovuthehusky.nbt
Class NBTReader
- java.lang.Object
-
- com.kovuthehusky.nbt.NBTReader
-
public class NBTReader extends java.lang.ObjectClass for reading NBT binary data from files.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static NBTCompoundread(byte[] bytes)Reads the byte array and returns the root compound tag and its children.static NBTCompoundread(byte[] bytes, byte compression)Reads the byte array and returns the root compound tag and its children.static NBTCompoundread(java.io.File file)Reads the file and returns the root compound tag and its children.static NBTCompoundread(java.io.File file, byte compression)Reads the file and returns the root compound tag and its children.
-
-
-
Field Detail
-
UNKNOWN
public static final byte UNKNOWN
- See Also:
- Constant Field Values
-
GZIP
public static final byte GZIP
- See Also:
- Constant Field Values
-
ZLIB
public static final byte ZLIB
- See Also:
- Constant Field Values
-
-
Method Detail
-
read
public static NBTCompound read(java.io.File file) throws java.io.IOException
Reads the file and returns the root compound tag and its children.- Parameters:
file- The file to read in as NBT data.- Returns:
- The root NBT tag.
- Throws:
java.io.IOException- If the file does not exist or is not NBT data.
-
read
public static NBTCompound read(java.io.File file, byte compression) throws java.io.IOException
Reads the file and returns the root compound tag and its children.- Parameters:
file- The file to read in as NBT data.compression- The type of compression that the NBT file uses.- Returns:
- The root NBT tag.
- Throws:
java.io.IOException- If the file does not exist or is not NBT data.
-
read
public static NBTCompound read(byte[] bytes) throws java.io.IOException
Reads the byte array and returns the root compound tag and its children.- Parameters:
bytes- The byte array to read in as NBT data.- Returns:
- The root NBT tag.
- Throws:
java.io.IOException- If the byte array is not NBT data.
-
read
public static NBTCompound read(byte[] bytes, byte compression) throws java.io.IOException
Reads the byte array and returns the root compound tag and its children.- Parameters:
bytes- The byte array to read in as NBT data.compression- The type of compression that the NBT byte array uses.- Returns:
- The root NBT tag.
- Throws:
java.io.IOException- If the byte array is not NBT data.
-
-