private void readHeaderFirst()

in jsign-core/src/main/java/net/jsign/mscab/CFHeader.java [104:127]


    private void readHeaderFirst(ByteBuffer buffer) throws IOException {
        buffer.get(this.signature);

        if (this.signature[0] != 'M' ||
                this.signature[1] != 'S' ||
                this.signature[2] != 'C' ||
                this.signature[3] != 'F') {
            throw new IOException("MSCabinet header signature not found");
        }

        this.csumHeader = buffer.getInt() & 0xFFFFFFFFL;  // u4
        this.cbCabinet = buffer.getInt() & 0xFFFFFFFFL;   // u4 H
        this.csumFolders = buffer.getInt() & 0xFFFFFFFFL; // u4 H
        this.coffFiles = buffer.getInt() & 0xFFFFFFFFL;   // u4 H
        this.csumFiles = buffer.getInt() & 0xFFFFFFFFL;   // u4 H
        this.versionMinor = buffer.get();                 // u1 H
        this.versionMajor = buffer.get();                 // u1 H
        this.cFolders = buffer.getShort() & 0xFFFF;       // u2 H
        this.cFiles = buffer.getShort() & 0xFFFF;         // u2 H
        this.flags = buffer.getShort() & 0xFFFF;          // u2 H
        this.setID = buffer.getShort();                   // u2 H
        this.iCabinet = buffer.getShort() & 0xFFFF;       // u2
        this.abReserved = null;
    }