Package net.kyori.adventure.nbt
Class TagStringIO
- java.lang.Object
-
- net.kyori.adventure.nbt.TagStringIO
-
public final class TagStringIO extends java.lang.ObjectA holder for string tag format options.- Since:
- 4.0.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTagStringIO.BuilderBuilder for a SNBT I/O handler.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CompoundBinaryTagasCompound(java.lang.String input)Read the string into a compound tag structure.java.lang.StringasString(CompoundBinaryTag input)Get a string representation of the provided tag.static @NotNull TagStringIO.Builderbuilder()Create an new builder to configure IO.static @NotNull TagStringIOget()Get an instance ofTagStringIOthat creates reads and writes using standard options.voidtoWriter(CompoundBinaryTag input, java.io.Writer dest)Writes a tag to in string format.
-
-
-
Method Detail
-
get
@NotNull public static @NotNull TagStringIO get()
Get an instance ofTagStringIOthat creates reads and writes using standard options.- Returns:
- the basic instance
- Since:
- 4.0.0
-
builder
@NotNull public static @NotNull TagStringIO.Builder builder()
Create an new builder to configure IO.- Returns:
- a builder
- Since:
- 4.0.0
-
asCompound
public CompoundBinaryTag asCompound(java.lang.String input) throws java.io.IOException
Read the string into a compound tag structure.When working with untrusted input (such as from the network), users should be careful to validate that the
inputstring is of a reasonable size.- Parameters:
input- Input data- Returns:
- this
- Throws:
java.io.IOException- on any syntax errors- Since:
- 4.0.0
-
asString
public java.lang.String asString(CompoundBinaryTag input) throws java.io.IOException
Get a string representation of the provided tag.- Parameters:
input- tag to serialize- Returns:
- serialized form
- Throws:
java.io.IOException- if any errors occur writing to string- Since:
- 4.0.0
-
toWriter
public void toWriter(CompoundBinaryTag input, java.io.Writer dest) throws java.io.IOException
Writes a tag to in string format.The provided
Writerwill remain open after reading a tag.- Parameters:
input- Tag to writedest- Writer to write to- Throws:
java.io.IOException- if any IO or syntax errors occur while parsing- Since:
- 4.0.0
-
-