Skip to content
This repository was archived by the owner on Apr 24, 2023. It is now read-only.

Commit ca39eb9

Browse files
author
Brian Burkhalter
committed
7093322: (fs spec) Files.newBufferedWriter should be clear when coding errors are detected
Reviewed-by: alanb
1 parent 2c42499 commit ca39eb9

File tree

1 file changed

+6
-1
lines changed
  • src/java.base/share/classes/java/nio/file

1 file changed

+6
-1
lines changed

src/java.base/share/classes/java/nio/file/Files.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2938,7 +2938,12 @@ public static BufferedReader newBufferedReader(Path path) throws IOException {
29382938
* a size of {@code 0} if it exists.
29392939
*
29402940
* <p> The {@code Writer} methods to write text throw {@code IOException}
2941-
* if the text cannot be encoded using the specified charset.
2941+
* if the text cannot be encoded using the specified charset. Due to
2942+
* buffering, an {@code IOException} caused by an encoding error
2943+
* (unmappable-character or malformed-input) may be thrown when {@linkplain
2944+
* BufferedWriter#write(char[],int,int) writing}, {@linkplain
2945+
* BufferedWriter#flush flushing}, or {@linkplain BufferedWriter#close
2946+
* closing} the buffered writer.
29422947
*
29432948
* @param path
29442949
* the path to the file

0 commit comments

Comments
 (0)