private void readNode(DataReader in, Node<T> node) throws IOException {
        int numFields = in.readInt();
        int stringTableLen = in.readInt();

        // read types
        List<T> types = new ArrayList<>(numFields);
        for (int j = 0; j < numFields; j++) {
            T type = createElement();
            in.readStruct(type);
            types.add(type);
        }

        // read local string table and add common strings
        BiMap<Integer, String> stringTable = StringTable.read(in, stringTableLen);
        stringTable.putAll(StringTable.commonStrings(revision.major()));

        // assign strings
        for (T field : types) {
            int nameOffset = field.nameOffset();
            String name = stringTable.get(nameOffset);

            if (name == null) {
                throw new SerializedFileException("No string table entry found for name index " + nameOffset);
            }

            field.fieldName(name);

            int typeOffset = field.typeOffset();
            String type = stringTable.get(typeOffset);

            if (name == null) {
                throw new SerializedFileException("No string table entry found for type index " + typeOffset);
            }

            field.typeName(type);
        }

        // convert list to tree structure
        Node<T> nodePrev = null;
        for (T type : types) {
            // create root node
            if (nodePrev == null) {
                node.data(type);
                nodePrev = node;
                continue;
            }

            Node<T> nodeCurr = new Node<>(type);

            int levels = nodePrev.data().treeLevel() - type.treeLevel();
            if (levels >= 0) {
                // move down in tree hierarchy if required
                for (int i = 0; i < levels; i++) {
                    nodePrev = nodePrev.parent();
                }

                nodePrev.parent().add(nodeCurr);
            } else {
                // can move only one level up at a time, so simply add the node
                nodePrev.add(nodeCurr);
            }

            nodePrev = nodeCurr;
        }
    }
@author Nico Bergemann <barracuda415 at yahoo.de>
disunity-core/src/main/java/info/ata4/junity/serialize/typetree/TypeTreeV3.java