Package net.glowstone.util.nbt
Class NbtOutputStream
java.lang.Object
net.glowstone.util.nbt.NbtOutputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
This class writes NBT, or Named Binary Tag,
Tag objects to an underlying
OutputStream.
The NBT format was created by Markus Persson, and the specification may be found at http://www.minecraft.net/docs/NBT.txt.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new NBTOutputStream, which will write data to the specified underlying output stream.NbtOutputStream(OutputStream os, boolean compressed) Creates a new NBTOutputStream, which will write data to the specified underlying output stream. -
Method Summary
-
Constructor Details
-
NbtOutputStream
Creates a new NBTOutputStream, which will write data to the specified underlying output stream. This assumes the output stream should be compressed with GZIP.- Parameters:
os- The output stream.- Throws:
IOException- if an I/O error occurs.
-
NbtOutputStream
Creates a new NBTOutputStream, which will write data to the specified underlying output stream. A flag indicates if the output should be compressed with GZIP or not.- Parameters:
os- The output stream.compressed- A flag that indicates if the output should be compressed.- Throws:
IOException- if an I/O error occurs.
-
-
Method Details
-
writeTag
Write a tag with a blank name (the root tag) to the stream.- Parameters:
tag- The tag to write.- Throws:
IOException- if an I/O error occurs.
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-