Class NbtInputStream

java.lang.Object
net.glowstone.util.nbt.NbtInputStream
All Implemented Interfaces:
Closeable, AutoCloseable

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 Details

    • NbtInputStream

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

      This assumes the stream is compressed.

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

      public NbtInputStream(InputStream is, boolean compressed) throws IOException
      Creates a new 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.

      Parameters:
      is - The input stream.
      compressed - A flag indicating if the stream is compressed.
      Throws:
      IOException - if an I/O error occurs.
  • Method Details