}
}
private void writeClassMetadata(List<ClassMetadata> classes) throws IOException {
for (int i = 0; i < classes.size(); ++i) {
ClassMetadata cls = classes.get(i);
writeUnsignedNumber(cls.parentId != null ? cls.parentId + 1 : 0);
writeUnsignedNumber(cls.fieldMap.size());
List<Integer> keys = new ArrayList<>(cls.fieldMap.keySet());
Collections.sort(keys);
resetRelativeNumber();