public static TagByteArray Read(EndianBinaryReader r) { int length = r.ReadInt32(); TagByteArray t = new TagByteArray(); t.ByteArray = r.ReadBytes(length); return(t); }
public static Tag ReadTagType(EndianBinaryReader r, byte type) { switch (type) { case 0: return(TagEnd.Read(r)); case 1: return(TagByte.Read(r)); case 2: return(TagShort.Read(r)); case 3: return(TagInt.Read(r)); case 4: return(TagLong.Read(r)); case 5: return(TagFloat.Read(r)); case 6: return(TagDouble.Read(r)); case 7: return(TagByteArray.Read(r)); case 8: return(TagString.Read(r)); case 9: return(TagListReader.Read(r)); case 10: return(TagCompound.Read(r)); case 11: return(TagIntArray.Read(r)); default: throw new NotImplementedException("NBT Tag type: " + type); } }