public class NBTIO extends Object
| Constructor and Description |
|---|
NBTIO() |
| Modifier and Type | Method and Description |
|---|---|
static CompoundTag |
readFile(File file)
Reads the compressed, big endian root CompoundTag from the given file.
|
static CompoundTag |
readFile(File file,
boolean compressed,
boolean littleEndian)
Reads the root CompoundTag from the given file.
|
static CompoundTag |
readFile(String path)
Reads the compressed, big endian root CompoundTag from the given file.
|
static CompoundTag |
readFile(String path,
boolean compressed,
boolean littleEndian)
Reads the root CompoundTag from the given file.
|
static Tag |
readTag(DataInput in)
Reads an NBT tag.
|
static Tag |
readTag(InputStream in)
Reads a big endian NBT tag.
|
static Tag |
readTag(InputStream in,
boolean littleEndian)
Reads an NBT tag.
|
static void |
writeFile(CompoundTag tag,
File file)
Writes the given root CompoundTag to the given file, compressed and in big endian.
|
static void |
writeFile(CompoundTag tag,
File file,
boolean compressed,
boolean littleEndian)
Writes the given root CompoundTag to the given file.
|
static void |
writeFile(CompoundTag tag,
String path)
Writes the given root CompoundTag to the given file, compressed and in big endian.
|
static void |
writeFile(CompoundTag tag,
String path,
boolean compressed,
boolean littleEndian)
Writes the given root CompoundTag to the given file.
|
static void |
writeTag(DataOutput out,
Tag tag)
Writes an NBT tag.
|
static void |
writeTag(OutputStream out,
Tag tag)
Writes an NBT tag in big endian.
|
static void |
writeTag(OutputStream out,
Tag tag,
boolean littleEndian)
Writes an NBT tag.
|
public static CompoundTag readFile(String path) throws IOException
path - Path of the file.IOException - If an I/O error occurs.public static CompoundTag readFile(File file) throws IOException
file - File to read from.IOException - If an I/O error occurs.public static CompoundTag readFile(String path, boolean compressed, boolean littleEndian) throws IOException
path - Path of the file.compressed - Whether the NBT file is compressed.littleEndian - Whether the NBT file is little endian.IOException - If an I/O error occurs.public static CompoundTag readFile(File file, boolean compressed, boolean littleEndian) throws IOException
file - File to read from.compressed - Whether the NBT file is compressed.littleEndian - Whether the NBT file is little endian.IOException - If an I/O error occurs.public static void writeFile(CompoundTag tag, String path) throws IOException
tag - Tag to write.path - Path to write to.IOException - If an I/O error occurs.public static void writeFile(CompoundTag tag, File file) throws IOException
tag - Tag to write.file - File to write to.IOException - If an I/O error occurs.public static void writeFile(CompoundTag tag, String path, boolean compressed, boolean littleEndian) throws IOException
tag - Tag to write.path - Path to write to.compressed - Whether the NBT file should be compressed.littleEndian - Whether to write little endian NBT.IOException - If an I/O error occurs.public static void writeFile(CompoundTag tag, File file, boolean compressed, boolean littleEndian) throws IOException
tag - Tag to write.file - File to write to.compressed - Whether the NBT file should be compressed.littleEndian - Whether to write little endian NBT.IOException - If an I/O error occurs.public static Tag readTag(InputStream in) throws IOException
in - Input stream to read from.IOException - If an I/O error occurs.public static Tag readTag(InputStream in, boolean littleEndian) throws IOException
in - Input stream to read from.littleEndian - Whether to read little endian NBT.IOException - If an I/O error occurs.public static Tag readTag(DataInput in) throws IOException
in - Data input to read from.IOException - If an I/O error occurs.public static void writeTag(OutputStream out, Tag tag) throws IOException
out - Output stream to write to.tag - Tag to write.IOException - If an I/O error occurs.public static void writeTag(OutputStream out, Tag tag, boolean littleEndian) throws IOException
out - Output stream to write to.tag - Tag to write.littleEndian - Whether to write little endian NBT.IOException - If an I/O error occurs.public static void writeTag(DataOutput out, Tag tag) throws IOException
out - Data output to write to.tag - Tag to write.IOException - If an I/O error occurs.Copyright © 2021. All rights reserved.