org.jnbt
Class NBTInputStream

java.lang.Object
  extended by org.jnbt.NBTInputStream
All Implemented Interfaces:
Closeable

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.

Author:
Graham Edgecombe

Constructor Summary
NBTInputStream(InputStream is)
          Creates a new NBTInputStream, which will source its data from the specified input stream.
 
Method Summary
 void close()
           
 Tag readTag()
          Reads an NBT tag from the stream.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NBTInputStream

public NBTInputStream(InputStream is)
               throws IOException
Creates a new NBTInputStream, which will source its data from the specified input stream.

Parameters:
is - The input stream.
Throws:
IOException - if an I/O error occurs.
Method Detail

readTag

public Tag readTag()
            throws IOException
Reads an NBT tag from the stream.

Returns:
The tag that was read.
Throws:
IOException - if an I/O error occurs.

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Throws:
IOException