From f2fb4a7e795bb180b0f24311f36d75a05999cd3c Mon Sep 17 00:00:00 2001 From: Esteban Herrera Date: Mon, 16 Dec 2019 17:36:54 -0600 Subject: [PATCH] Fix issue #89 --- ch23.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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.