public final class NBTOutputStream extends Object implements Closeable
Tag objects to an underlying OutputStream. The NBT format was created by Markus Persson, and the specification may be found
at https://flowpowered.com/nbt/spec.txt.| Constructor and Description |
|---|
NBTOutputStream(OutputStream os)
Creates 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. |
NBTOutputStream(OutputStream os,
boolean compressed,
ByteOrder endianness)
Creates a new
NBTOutputStream, which will write data to the specified underlying output stream. |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
flush()
Flushes the stream
|
ByteOrder |
getEndianness() |
void |
writeTag(Tag<?> tag)
Writes a tag.
|
public NBTOutputStream(OutputStream os) throws IOException
NBTOutputStream, which will write data to the specified underlying output stream. This assumes the output stream should be compressed with GZIP.os - The output stream.IOException - if an I/O error occurs.public NBTOutputStream(OutputStream os, boolean compressed) throws IOException
NBTOutputStream, which will write data to the specified underlying output stream. A flag indicates if the output should be compressed with GZIP or not.os - The output stream.compressed - A flag that indicates if the output should be compressed.IOException - if an I/O error occurs.public NBTOutputStream(OutputStream os, boolean compressed, ByteOrder endianness) throws IOException
NBTOutputStream, which will write data to the specified underlying output stream. A flag indicates if the output should be compressed with GZIP or not.os - The output stream.compressed - A flag that indicates if the output should be compressed.endianness - A flag that indicates if numbers in the output should be output in little-endian format.IOException - if an I/O error occurs.public void writeTag(Tag<?> tag) throws IOException
tag - The tag to write.IOException - if an I/O error occurs.public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic ByteOrder getEndianness()
public void flush()
throws IOException
IOExceptionCopyright © 2011–2014 Flow Powered. All rights reserved.