I agree with the fix.

In test/java/io/OutputStreamWriter/Flush.java I suggest:
a) As all values are positive, following would be better readable:
    byte[] bytes = new byte[] {0x1b, 0x24, 0x42, 0x3a, 0x47, 0x1b, 0x28, 0x42};
... or remember the format rule - which I still don't like - to insert a space 
after the cast. ;-)
b) Use the promoted /ugly/ Byte.toUnsignedInt(b) method.
c) Use smart for...each loop
d) I guess, you meant one ':' after "Result"
e) Print "Expected/Result:   0x12 0x34 0x56 ..." in _one_ line, with the values 
vertically alingned.
f) Anyway, for the output you could use:
    private static Formatter formatBytes(CharSequence label, byte[] bytes) {
        Formatter f = new Formatter(new StringBuilder(label));
// Formatter f = new Formatter(new StringBuilder(label.length() + 5 * bytes.length).append(label));
        for (byte b : bytes)
            f.format(" 0x%x", b  Byte.toUnsignedInt(b));
        return f;
    }
...
    System.out.println(formatBytes("Expected:", expected));
    System.out.println(formatBytes("Result:  ", result));


-Ulf

Reply via email to