Package net.kyori.adventure.nbt
Class BinaryTagIO
java.lang.Object
net.kyori.adventure.nbt.BinaryTagIO
public final class BinaryTagIO extends Object
Serialization operations for binary tags.
- Since:
- 4.0.0
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBinaryTagIO.CompressionCompression types.static interfaceBinaryTagIO.ReaderCompoundBinaryTagreader.static interfaceBinaryTagIO.WriterCompoundBinaryTagwriter. -
Method Summary
Modifier and Type Method Description static @NonNull CompoundBinaryTagreadCompressedInputStream(@NonNull InputStream input)Deprecated.static @NonNull CompoundBinaryTagreadCompressedPath(@NonNull Path path)Deprecated.since 4.4.0, usereader()static @NonNull CompoundBinaryTagreadDataInput(@NonNull DataInput input)Deprecated.since 4.4.0, usereader()static @NonNull BinaryTagIO.Readerreader()ReturnsBinaryTagIO.Reader, used to read binary tags.static @NonNull BinaryTagIO.Readerreader(long sizeLimitBytes)ReturnsBinaryTagIO.Reader, used to read binary tags.static @NonNull CompoundBinaryTagreadInputStream(@NonNull InputStream input)Deprecated.since 4.4.0, usereader()static @NonNull CompoundBinaryTagreadPath(@NonNull Path path)Deprecated.since 4.4.0, usereader()static @NonNull BinaryTagIO.ReaderunlimitedReader()ReturnsBinaryTagIO.Reader, used to read binary tags.static voidwriteCompressedOutputStream(@NonNull CompoundBinaryTag tag, @NonNull OutputStream output)Deprecated.since 4.4.0, usewriter()static voidwriteCompressedPath(@NonNull CompoundBinaryTag tag, @NonNull Path path)Deprecated.since 4.4.0, usewriter()static voidwriteDataOutput(@NonNull CompoundBinaryTag tag, @NonNull DataOutput output)Deprecated.since 4.4.0, usewriter()static voidwriteOutputStream(@NonNull CompoundBinaryTag tag, @NonNull OutputStream output)Deprecated.since 4.4.0, usewriter()static voidwritePath(@NonNull CompoundBinaryTag tag, @NonNull Path path)Deprecated.since 4.4.0, usewriter()static @NonNull BinaryTagIO.Writerwriter()ReturnsBinaryTagIO.Writer, used to write binary tags.
-
Method Details
-
unlimitedReader
ReturnsBinaryTagIO.Reader, used to read binary tags.There is a maximum depth of
512nested tags allowed, but no limit for the amount of containe data.- Returns:
- binary tag reader
- Since:
- 4.4.0
-
reader
ReturnsBinaryTagIO.Reader, used to read binary tags.This reader has a size limit for the estimated number of data bytes for a tag.
- Returns:
- binary tag reader
- Since:
- 4.4.0
-
reader
ReturnsBinaryTagIO.Reader, used to read binary tags.This reader will limit the number of bytes read to the approximate size limit indicated.
- Returns:
- binary tag reader
- Since:
- 4.4.0
-
writer
ReturnsBinaryTagIO.Writer, used to write binary tags.- Returns:
- binary tag writer
- Since:
- 4.4.0
-
readPath
@Deprecated public static @NonNull CompoundBinaryTag readPath(@NonNull Path path) throws IOExceptionDeprecated.since 4.4.0, usereader()Reads a compound tag frompath.- Parameters:
path- the path- Returns:
- the compound tag
- Throws:
IOException- if an exception was encountered while reading a compound tag- Since:
- 4.0.0
-
readInputStream
@Deprecated public static @NonNull CompoundBinaryTag readInputStream(@NonNull InputStream input) throws IOExceptionDeprecated.since 4.4.0, usereader()Reads a compound tag from an input stream. The stream is not closed afterwards.- Parameters:
input- the input stream- Returns:
- the compound tag
- Throws:
IOException- if an exception was encountered while reading a compound tag- Since:
- 4.0.0
-
readCompressedPath
@Deprecated public static @NonNull CompoundBinaryTag readCompressedPath(@NonNull Path path) throws IOExceptionDeprecated.since 4.4.0, usereader()Reads a compound tag frompathusing GZIP decompression.- Parameters:
path- the path- Returns:
- the compound tag
- Throws:
IOException- if an exception was encountered while reading a compound tag- Since:
- 4.0.0
-
readCompressedInputStream
@Deprecated public static @NonNull CompoundBinaryTag readCompressedInputStream(@NonNull InputStream input) throws IOExceptionDeprecated.since 4.4.0, usereader()Reads a compound tag from an input stream using GZIP decompression. The stream is not closed afterwards.- Parameters:
input- the input stream- Returns:
- the compound tag
- Throws:
IOException- if an exception was encountered while reading a compound tag- Since:
- 4.0.0
-
readDataInput
@Deprecated public static @NonNull CompoundBinaryTag readDataInput(@NonNull DataInput input) throws IOExceptionDeprecated.since 4.4.0, usereader()Reads a compound tag frominput.- Parameters:
input- the input- Returns:
- the compound tag
- Throws:
IOException- if an exception was encountered while reading a compound tag- Since:
- 4.0.0
-
writePath
@Deprecated public static void writePath(@NonNull CompoundBinaryTag tag, @NonNull Path path) throws IOExceptionDeprecated.since 4.4.0, usewriter()Writes a compound tag topath.- Parameters:
tag- the compound tagpath- the path- Throws:
IOException- if an exception was encountered while writing the compound tag- Since:
- 4.0.0
-
writeOutputStream
@Deprecated public static void writeOutputStream(@NonNull CompoundBinaryTag tag, @NonNull OutputStream output) throws IOExceptionDeprecated.since 4.4.0, usewriter()Writes a compound tag to an output stream. The output stream will not be closed.- Parameters:
tag- the compound tagoutput- the output stream- Throws:
IOException- if an exception was encountered while writing the compound tag- Since:
- 4.0.0
-
writeCompressedPath
@Deprecated public static void writeCompressedPath(@NonNull CompoundBinaryTag tag, @NonNull Path path) throws IOExceptionDeprecated.since 4.4.0, usewriter()Writes a compound tag topathusing GZIP compression.- Parameters:
tag- the compound tagpath- the path- Throws:
IOException- if an exception was encountered while writing the compound tag- Since:
- 4.0.0
-
writeCompressedOutputStream
@Deprecated public static void writeCompressedOutputStream(@NonNull CompoundBinaryTag tag, @NonNull OutputStream output) throws IOExceptionDeprecated.since 4.4.0, usewriter()Writes a compound tag to an output stream using GZIP compression. The output stream is not closed afterwards.- Parameters:
tag- the compound tagoutput- the output stream- Throws:
IOException- if an exception was encountered while writing the compound tag- Since:
- 4.0.0
-
writeDataOutput
@Deprecated public static void writeDataOutput(@NonNull CompoundBinaryTag tag, @NonNull DataOutput output) throws IOExceptionDeprecated.since 4.4.0, usewriter()Writes a compound tag tooutput.- Parameters:
tag- the compound tagoutput- the output- Throws:
IOException- if an exception was encountered while writing the compound tag- Since:
- 4.0.0
-
reader()