public boolean compare(final String name, final int[] valid, final int actual) throws ImagingException {
        for (final int element : valid) {
            if (actual == element) {
                return true;
            }
        }

        final StringBuilder result = new StringBuilder(43);
        result.append(name);
        result.append(": Unexpected value: (valid: ");
        if (valid.length > 1) {
            result.append('{');
        }
        for (int i = 0; i < valid.length; i++) {
            if (i > 0) {
                result.append(", ");
            }
            result.append(getValueDescription(valid[i]));
        }
        if (valid.length > 1) {
            result.append('}');
        }
        result.append(", actual: ").append(getValueDescription(actual)).append(")");
        addComment(result.toString());
        return false;
    }
Provides information about the compliance of a specified data source (byte array, file, etc&#46;) to an image format.
src/main/java/org/apache/commons/imaging/FormatCompliance.java