public void validateChecksum() throws IOException {
        if (cis == null) {
            readRawInt32();
        } else {
            int calculatedChecksum = (int) cis.getChecksum().getValue();
            int checksumFromStream = (int) readRawInt32();
            if (calculatedChecksum != checksumFromStream) {
                throw new RuntimeException(String.format("Invalid footer checksum, expected %X got %X", calculatedChecksum, checksumFromStream));
            }
        }
    }