public boolean compareBytes(final String name, final byte[] expected, final byte[] actual) throws ImagingException {
        if (expected.length != actual.length) {
            addComment(name + ": " + "Unexpected length: (expected: " + expected.length + ", actual: " + actual.length + ")");
            return false;
        }
        for (int i = 0; i < expected.length; i++) {
            // System.out.println("expected: "
            // + getValueDescription(expected[i]) + ", actual: "
            // + getValueDescription(actual[i]) + ")");
            if (expected[i] != actual[i]) {
                addComment(
                        name + ": " + "Unexpected value: (expected: " + getValueDescription(expected[i]) + ", actual: " + getValueDescription(actual[i]) + ")");
                return false;
            }
        }

        return true;
    }
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