There is however this problematic statement in the PrintStream class doc that 
neither of the two alternative versions of the fix addresses:

"Two other features are provided as well. Unlike other output streams, a 
PrintStream never throws an IOException; instead, exceptional situations merely 
set an internal flag that can be tested via the checkError method.”

In both cases this would need to be changed as it is incorrect.

Brian

> On Jul 15, 2019, at 10:14 AM, Brian Burkhalter <brian.burkhal...@oracle.com> 
> wrote:
> 
> Here is an alternative version which adds a writeBytes(byte[]) method instead 
> of overriding write(byte[]):
> 
> http://cr.openjdk.java.net/~bpb/8187898/webrev-alt.00/ 
> <http://cr.openjdk.java.net/~bpb/8187898/webrev-alt.00/> 
> <http://cr.openjdk.java.net/~bpb/8187898/webrev-alt.00/ 
> <http://cr.openjdk.java.net/~bpb/8187898/webrev-alt.00/>>
> 
> This has the advantage of allowing new code to call writeBytes() without a 
> try-catch block without introducing a compatibility issue for code which is 
> already calling write(byte[]) in a try-catch block.

Reply via email to