class NisoImageMetadata {

    public static String extractIccProfileDescription(byte[] data) throws IllegalArgumentException {
    	// Validate the ICCProfile with the java library
        ICC_Profile profile = ICC_Profile.getInstance(data);
    	// Extract the 'desc' record (cf http://www.color.org/ICC1-V41.pdf)
        byte[] dataProf = profile.getData(ICC_Profile.icSigProfileDescriptionTag);
    	if (dataProf == null) {
    		return null;
    	}

    	String description = null;
        ByteBuffer bb = ByteBuffer.wrap(dataProf).asReadOnlyBuffer();
        int majorVersion = profile.getMajorVersion();
        int minorVersion = profile.getMinorVersion();
        LOGGER.fine("Version " + majorVersion + "." + minorVersion);

        int beginTag = bb.getInt(0);
        if (beginTag == ICC_Profile.icSigProfileDescriptionTag) {
            // Invariant option
        	// ICC v2 http://www.color.org/ICC_Minor_Revision_for_Web.pdf
	    	// Read only the ASCII form (cf 6.5.17 ICC v2)
	    	final int OFFSET_LENGTH = 8;
	    	final int OFFSET_DESC = OFFSET_LENGTH + 4;

	    	int lengthAscii = bb.getInt(OFFSET_LENGTH);

	    	// readString
	    	byte[] asciiDesc = new byte[lengthAscii -1];
	    	bb.position(OFFSET_DESC);
	    	bb.get(asciiDesc);

			description = new String(asciiDesc, StandardCharsets.US_ASCII);
    	} else {
        	// ICC v4 http://www.color.org/ICC1-V41.pdf
            final int OFFSET_NUMBER = 8;
	    	final int MLUC_TAG = 0x6D6C7563;
	    	final int OFFSET_NAME_LENGTH = 20;
	    	final int OFFSET_NAME_OFFSET = 24;

    		// 6.2 segment tag table definition
            int tagMluc = bb.getInt(0);

        	// Read the 1st mulc form (cf 6.5.12 ICC v4)
    		int nb =  bb.getInt(OFFSET_NUMBER);
    		if (tagMluc != MLUC_TAG || nb < 1) {
                throw new IllegalArgumentException(CoreMessageConstants.ERR_ICC_PRFL_DESC_MISS);
    		}
    		int firstNameLength = bb.getInt(OFFSET_NAME_LENGTH);
    		int firstNameOffset = bb.getInt(OFFSET_NAME_OFFSET);
        	// readString
        	byte[] desc = new byte[firstNameLength];
        	bb.position(firstNameOffset);
        	bb.get(desc);

            // The  Unicode  strings  in  storage  are  encoded  as  16-bit
            // big-endian,  UTF-16BE,  and should not be NULL terminated.
            description = new String(desc, StandardCharsets.UTF_16BE);
    	}
    	return description;
    }

    public  NisoImageMetadata();

}