Example #1
0
 @Override
 public NBTList<NBTRecord> read(final PushBackReader in, final String name) throws IOException {
   final NBTType type = forTagId(in.readByte());
   final int length = in.readInt();
   final NBTRecord[] list = new NBTRecord[length];
   for (int i = 0; i < length; ++i) {
     list[i] = type.read(in, null);
   }
   return new NBTList<NBTRecord>(name, type, list);
 }
Example #2
0
 /**
  * Reads a record from the stream.
  *
  * @param in The stream.
  * @return The record.
  * @throws IOException I/O Exception.
  */
 public static final NBTRecord readRecord(final PushBackReader in) throws IOException {
   final NBTType type = forTagId(in.readByte());
   final String name = type == END ? null : in.readString();
   return type.read(in, name);
 }