public final class NBTOutputStream
extends java.lang.Object
implements java.io.Closeable
Tag
objects to an underlying OutputStream
.
The NBT format was created by Markus Persson, and the specification may be found at https://minecraft.gamepedia.com/NBT_format.
Constructor and Description |
---|
NBTOutputStream(java.io.OutputStream os)
Creates a new
NBTOutputStream , which will write data to the
specified underlying output stream. |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
writeNamedTag(java.lang.String name,
Tag tag)
Writes a tag.
|
public NBTOutputStream(java.io.OutputStream os) throws java.io.IOException
NBTOutputStream
, which will write data to the
specified underlying output stream.os
- The output stream.java.io.IOException
- if an I/O error occurs.public void writeNamedTag(java.lang.String name, Tag tag) throws java.io.IOException
tag
- The tag to write.java.io.IOException
- if an I/O error occurs.public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException