testing/testutils/src/main/java/org/apache/axiom/testutils/io/CharacterStreamComparator.java [59:93]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public void write(char[] buffer, int off, int len) throws IOException {
        while (len > 0) {
            int c = in.read(compareBuffer, 0, Math.min(compareBuffer.length, len));
            if (c == -1) {
                fail(
                        "The two streams have different lengths: len("
                                + name1
                                + ") = "
                                + position
                                + " < len("
                                + name2
                                + ")");
            }
            for (int i = 0; i < c; i++) {
                if (buffer[off] != compareBuffer[i]) {
                    fail(
                            "Byte mismatch: "
                                    + name1
                                    + "["
                                    + position
                                    + "] = "
                                    + compareBuffer[i]
                                    + " != "
                                    + name2
                                    + "["
                                    + position
                                    + "] = "
                                    + buffer[off]);
                }
                off++;
                len--;
                position++;
            }
        }
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



testing/testutils/src/main/java/org/apache/axiom/testutils/io/ByteStreamComparator.java [59:93]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public void write(byte[] buffer, int off, int len) throws IOException {
        while (len > 0) {
            int c = in.read(compareBuffer, 0, Math.min(compareBuffer.length, len));
            if (c == -1) {
                fail(
                        "The two streams have different lengths: len("
                                + name1
                                + ") = "
                                + position
                                + " < len("
                                + name2
                                + ")");
            }
            for (int i = 0; i < c; i++) {
                if (buffer[off] != compareBuffer[i]) {
                    fail(
                            "Byte mismatch: "
                                    + name1
                                    + "["
                                    + position
                                    + "] = "
                                    + compareBuffer[i]
                                    + " != "
                                    + name2
                                    + "["
                                    + position
                                    + "] = "
                                    + buffer[off]);
                }
                off++;
                len--;
                position++;
            }
        }
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



