RFR: 7093322: (fs spec) Files.newBufferedWriter should be clear when coding errors are detected
Alan Bateman
alanb at openjdk.org
Sat Dec 10 08:58:58 UTC 2022
On Fri, 9 Dec 2022 20:28:31 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:
> Add a sentence to clarify that coding exceptions are not thrown until the characters are actually written to the underlying stream.
src/java.base/share/classes/java/nio/file/Files.java line 2946:
> 2944: * {@linkplain BufferedWriter#close close()} or
> 2945: * {@linkplain BufferedWriter#flush flush()}
> 2946: * was invoked explicitly on the returned {@code BufferedWriter}.
There isn't an "underlying stream" here but "file" could work. Alternatively, maybe this would work:
"Due to buffering, an IOException due to an encoding error (unmappable-character or malformed-input) may be thrown when writing, flushing or closing the buffered writer."
-------------
PR: https://git.openjdk.org/jdk/pull/11616
More information about the nio-dev
mailing list