diff --git a/src/java.base/share/classes/java/nio/file/Files.java b/src/java.base/share/classes/java/nio/file/Files.java index 601dd99d461e5..682340614a653 100644 --- a/src/java.base/share/classes/java/nio/file/Files.java +++ b/src/java.base/share/classes/java/nio/file/Files.java @@ -2938,7 +2938,12 @@ public static BufferedReader newBufferedReader(Path path) throws IOException { * a size of {@code 0} if it exists. * *

The {@code Writer} methods to write text throw {@code IOException} - * if the text cannot be encoded using the specified charset. + * if the text cannot be encoded using the specified charset. Due to + * buffering, an {@code IOException} caused by an encoding error + * (unmappable-character or malformed-input) may be thrown when {@linkplain + * BufferedWriter#write(char[],int,int) writing}, {@linkplain + * BufferedWriter#flush flushing}, or {@linkplain BufferedWriter#close + * closing} the buffered writer. * * @param path * the path to the file