public final class NBTInputStream extends Object implements Closeable
This class reads NBT, or
Named Binary Tag streams, and produces an object graph of
subclasses of the Tag object.
The NBT format was created by Markus Persson, and the specification may be found at http://www.minecraft.net/docs/NBT.txt.
| Constructor and Description |
|---|
NBTInputStream(InputStream is)
Creates a new
NBTInputStream, which will source its data
from the specified input stream, which is assumed to contain big
endian data, or if the input stream is already a DataInput
stream, the stream's default byte order. |
NBTInputStream(InputStream is,
boolean littleEndian)
Creates a new
NBTInputStream, which will source its data
from the specified input stream. |
public NBTInputStream(InputStream is)
NBTInputStream, which will source its data
from the specified input stream, which is assumed to contain big
endian data, or if the input stream is already a DataInput
stream, the stream's default byte order.is - The input stream.public NBTInputStream(InputStream is, boolean littleEndian)
NBTInputStream, which will source its data
from the specified input stream.is - The input stream.littleEndian - Whether the stream contains little endian data.public Tag readTag() throws IOException
IOException - if an I/O error occurs.public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOException