@Override
    public void read(DataReader in) throws IOException {
        signature = in.readStringNull();
        streamVersion = in.readInt();
        unityVersion = new UnityVersion(in.readStringNull());
        unityRevision = new UnityVersion(in.readStringNull());

        if (signature.equals(SIGNATURE_FS)) {
            // FS signature
            // Expect streamVersion == 6
            completeFileSize = in.readLong();
            compressedDataHeaderSize = in.readInt();
            dataHeaderSize = in.readInt();
            flags = in.readInt();

            headerSize = (int) in.position();

            if ((flags & 0x80) == 0) {
                // The data header is part of the bundle header
                headerSize += compressedDataHeaderSize;
            }
            // else it's at the end of the file
        } else {
            // Web or Raw signature
            minimumStreamedBytes = in.readUnsignedInt();
            headerSize = in.readInt();

            numberOfLevelsToDownload = in.readInt();
            int numberOfLevels = in.readInt();

            levelByteEnd.clear();
            for (int i = 0; i < numberOfLevels; i++) {
                levelByteEnd.add(new ImmutablePair(in.readUnsignedInt(), in.readUnsignedInt()));
            }

            if (streamVersion >= 2) {
                completeFileSize = in.readUnsignedInt();
            }

            if (streamVersion >= 3) {
                dataHeaderSize = in.readUnsignedInt();
            }

            in.readByte();
        }
    }
Structure for Unity asset bundles.

@author Nico Bergemann <barracuda415 at yahoo.de>
@unity UnityWebStreamHeader
disunity-core/src/main/java/info/ata4/junity/bundle/BundleHeader.java