diff --git a/ch23.html b/ch23.html index 5fb07de..38c1450 100644 --- a/ch23.html +++ b/ch23.html @@ -324,7 +324,7 @@

BufferedWriter

try ( BufferedWriter bw =
     new BufferedWriter( new FileWriter("/file.txt") ) ) {
-    w.newLine("Writing to the file...");
+    w.write("Writing to the file...");
} catch(IOException e) { /** ... */ }

Since data is written to a buffer first, you can call the flush() method to make sure that the text written until that moment is indeed written to the disk.