RFC on 8179662: OutputStreamWriter javadocs states that you can set the buffer size but there is no way to do that

Brian Burkhalter brian.burkhalter at oracle.com
Mon May 8 22:24:08 UTC 2017

This issue [1] does in fact appear to be a bug. It could be fixed in one of three ways:

A) Remove the fallacious sentence "The size of this buffer may be specified, but by default it is large enough for most purposes.” from the second paragraph of the class documentation. This would at least make the specification consistent with the behavior without removing any functionality and could be done for JDK 9.

B) Add constructors (and the supporting methods in sun.nio.cs.CtreamEncoder) which would permit specifying the buffer size. This would make the behavior consistent with the specification but would have to be targeted to JDK 10.

C) Do option A for JDK 9 and (possibly) file an enhancement issue for option B for JDK 10.

Any opinions as to which option would be preferable?

Another possibility would be to have some kind of “setBufferSize()” capability which I think would add less API but ultimately more code.



[1] https://bugs.openjdk.java.net/browse/JDK-8179662

More information about the core-libs-dev mailing list