Package net.kyori.adventure.nbt
Class TagStringIO
java.lang.Object
net.kyori.adventure.nbt.TagStringIO
A holder for string tag format options.
- Since:
- 4.0.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder for a SNBT I/O handler. -
Method Summary
Modifier and TypeMethodDescriptionasCompound(String input) Read the string into a compound tag structure.asString(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, Writer dest) Writes a tag to in string format.
-
Method Details
-
get
Get an instance ofTagStringIOthat creates reads and writes using standard options.- Returns:
- the basic instance
- Since:
- 4.0.0
-
builder
Create an new builder to configure IO.- Returns:
- a builder
- Since:
- 4.0.0
-
asCompound
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:
IOException- on any syntax errors- Since:
- 4.0.0
-
asString
Get a string representation of the provided tag.- Parameters:
input- tag to serialize- Returns:
- serialized form
- Throws:
IOException- if any errors occur writing to string- Since:
- 4.0.0
-
toWriter
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:
IOException- if any IO or syntax errors occur while parsing- Since:
- 4.0.0
-