Package com.viaversion.nbt.io
Class TagWriter
java.lang.Object
com.viaversion.nbt.io.TagWriter
Reusable NBT tag writer.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionnamed()Sets this writer to write a named tag.voidwrite(DataOutput out, Tag tag) Writes the tag to the given data output.voidwrite(OutputStream out, Tag tag) Writes the tag to the given output stream.voidWrites the tag to the given path.
-
Constructor Details
-
TagWriter
public TagWriter()
-
-
Method Details
-
named
Sets this writer to write a named tag.- Returns:
- self
-
write
Writes the tag to the given data output.- Parameters:
out- output stream to write totag- tag to write- Throws:
IOException- if an I/O error occurs
-
write
Writes the tag to the given output stream.- Parameters:
out- output stream to write totag- tag to write- Throws:
IOException- if an I/O error occurs
-
write
Writes the tag to the given path. At least so far, the standard format is always named, so make sure to callnamed().- Parameters:
path- path to write totag- tag to writecompressed- whether to compress the file- Throws:
IOException- if an I/O error occurs
-