Package net.minecraft.nbt
Class NbtIo
java.lang.Object
net.minecraft.nbt.NbtIo
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static DataOutputStream
createCompressorStream
(OutputStream outputSteam) private static DataInputStream
createDecompressorStream
(InputStream zippedStream) static void
parse
(DataInput input, StreamTagVisitor visitor, NbtAccounter accounter) static void
parseCompressed
(InputStream zippedStream, StreamTagVisitor visitor, NbtAccounter accounter) static void
parseCompressed
(Path path, StreamTagVisitor visitor, NbtAccounter accounter) static CompoundTag
Reads a compound tag from a file.static CompoundTag
read
(DataInput input, NbtAccounter accounter) Reads a compound tag from a file.static CompoundTag
static Tag
readAnyTag
(DataInput input, NbtAccounter accounter) static CompoundTag
readCompressed
(InputStream zippedStream, NbtAccounter accounter) static CompoundTag
readCompressed
(Path path, NbtAccounter accounter) private static Tag
readTagSafe
(DataInput input, NbtAccounter accounter, byte type) private static Tag
readUnnamedTag
(DataInput input, NbtAccounter accounter) static void
write
(CompoundTag compoundTag, DataOutput output) static void
write
(CompoundTag compoundTag, Path path) static void
writeAnyTag
(Tag tag, DataOutput output) static void
writeCompressed
(CompoundTag compoundTag, OutputStream outputStream) Writes and compresses a compound tag to a GNU zipped file.static void
writeCompressed
(CompoundTag compoundTag, Path path) static void
writeUnnamedTag
(Tag tag, DataOutput output) static void
writeUnnamedTagWithFallback
(Tag tag, DataOutput output)
-
Field Details
-
SYNC_OUTPUT_OPTIONS
-
-
Constructor Details
-
NbtIo
public NbtIo()
-
-
Method Details
-
readCompressed
- Throws:
IOException
-
createDecompressorStream
private static DataInputStream createDecompressorStream(InputStream zippedStream) throws IOException - Throws:
IOException
-
createCompressorStream
- Throws:
IOException
-
readCompressed
public static CompoundTag readCompressed(InputStream zippedStream, NbtAccounter accounter) throws IOException - Throws:
IOException
-
parseCompressed
public static void parseCompressed(Path path, StreamTagVisitor visitor, NbtAccounter accounter) throws IOException - Throws:
IOException
-
parseCompressed
public static void parseCompressed(InputStream zippedStream, StreamTagVisitor visitor, NbtAccounter accounter) throws IOException - Throws:
IOException
-
writeCompressed
- Throws:
IOException
-
writeCompressed
public static void writeCompressed(CompoundTag compoundTag, OutputStream outputStream) throws IOException Writes and compresses a compound tag to a GNU zipped file.- Throws:
IOException
- See Also:
-
write
- Throws:
IOException
-
read
- Throws:
IOException
-
read
Reads a compound tag from a file. The size of the file can be infinite.- Throws:
IOException
-
read
Reads a compound tag from a file. The size of the file is limited by theaccounter
.- Throws:
RuntimeException
- if the size of the file is larger than the maximum amount of bytes specified by theaccounter
IOException
-
write
- Throws:
IOException
-
parse
public static void parse(DataInput input, StreamTagVisitor visitor, NbtAccounter accounter) throws IOException - Throws:
IOException
-
readAnyTag
- Throws:
IOException
-
writeAnyTag
- Throws:
IOException
-
writeUnnamedTag
- Throws:
IOException
-
writeUnnamedTagWithFallback
- Throws:
IOException
-
readUnnamedTag
- Throws:
IOException
-
readTagSafe
-