public SerializedFile read() throws IOException {
        this.serialized = new SerializedFile();

        // header is always big endian
        in.order(ByteOrder.BIG_ENDIAN);

        readHeader(in);

        SerializedFileHeader header = serialized.header();

        // older formats store the object data before the structure data
        if (header.version() < 9) {
            in.position(header.fileSize() - header.metadataSize() + 1);
        }

        // newer formats use little endian for the rest of the file
        if (header.version() > 5) {
            in.order(ByteOrder.LITTLE_ENDIAN);
        }

        readMetadata(in);
        readObjects(in);

        serialized.audioBuffer(resourceBuffer);

        return serialized;
    }
@author Nico Bergemann <barracuda415 at yahoo.de>
disunity-core/src/main/java/info/ata4/junity/serialize/SerializedFileReader.java