public final class NBTInputStream extends Object implements Closeable
Tag object. The NBT format was created by Markus Persson, and the specification
may be found at https://flowpowered.com/nbt/spec.txt.| Constructor and Description |
|---|
NBTInputStream(InputStream is)
Creates a new
NBTInputStream, which will source its data from the specified input stream. |
NBTInputStream(InputStream is,
boolean compressed)
Creates a new
NBTInputStream, which sources its data from the specified input stream. |
NBTInputStream(InputStream is,
boolean compressed,
ByteOrder endianness)
Creates a new
NBTInputStream, which sources its data from the specified input stream. |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
ByteOrder |
getByteOrder() |
Tag |
readTag()
Reads an NBT
Tag from the stream. |
public NBTInputStream(InputStream is) throws IOException
NBTInputStream, which will source its data from the specified input stream. This assumes the stream is compressed.is - The input stream.IOException - if an I/O error occurs.public NBTInputStream(InputStream is, boolean compressed) throws IOException
NBTInputStream, which sources its data from the specified input stream. A flag must be passed which indicates if the stream is compressed with GZIP or not. This assumes the
stream uses big endian encoding.is - The input stream.compressed - A flag indicating if the stream is compressed.IOException - if an I/O error occurs.public NBTInputStream(InputStream is, boolean compressed, ByteOrder endianness) throws IOException
NBTInputStream, which sources its data from the specified input stream. A flag must be passed which indicates if the stream is compressed with GZIP or not.is - The input stream.compressed - A flag indicating if the stream is compressed.endianness - Whether to read numbers from the InputStream with little endian encoding.IOException - if an I/O error occurs.public Tag readTag() throws IOException
Tag from the stream.IOException - if an I/O error occurs.public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic ByteOrder getByteOrder()
Copyright © 2011–2014 Flow Powered. All rights reserved.