@SuppressWarnings("unchecked") void load(DataInput dis) throws IOException { type = dis.readByte(); int size = dis.readInt(); list = new ArrayList<T>(); for (int i = 0; i < size; i++) { Tag tag = Tag.newTag(type, null); tag.load(dis); list.add((T) tag); } }