You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2012/05/28 16:27:46 UTC

svn commit: r1343264 - /commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileUtils.java

Author: ggregory
Date: Mon May 28 14:27:46 2012
New Revision: 1343264

URL: http://svn.apache.org/viewvc?rev=1343264&view=rev
Log:
[IO-329] FileUtils.writeLines uses unbuffered IO.

Modified:
    commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileUtils.java

Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileUtils.java?rev=1343264&r1=1343263&r2=1343264&view=diff
==============================================================================
--- commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileUtils.java (original)
+++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileUtils.java Mon May 28 14:27:46 2012
@@ -2206,7 +2206,9 @@ public class FileUtils {
         FileOutputStream out = null;
         try {
             out = openOutputStream(file, append);
-            IOUtils.writeLines(lines, lineEnding, new BufferedOutputStream(out), encoding);
+            final BufferedOutputStream buffer = new BufferedOutputStream(out);
+            IOUtils.writeLines(lines, lineEnding, buffer, encoding);
+            buffer.flush();
             out.close(); // don't swallow close Exception if copy completes normally
         } finally {
             IOUtils.closeQuietly(out);