commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1343253 - in /commons/proper/io/trunk/src: changes/changes.xml main/java/org/apache/commons/io/FileUtils.java
Date Mon, 28 May 2012 13:42:40 GMT
Author: ggregory
Date: Mon May 28 13:42:40 2012
New Revision: 1343253

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

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

Modified: commons/proper/io/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/changes/changes.xml?rev=1343253&r1=1343252&r2=1343253&view=diff
==============================================================================
--- commons/proper/io/trunk/src/changes/changes.xml (original)
+++ commons/proper/io/trunk/src/changes/changes.xml Mon May 28 13:42:40 2012
@@ -47,6 +47,9 @@ The <action> type attribute can be add,u
   <body>
     <!-- The release date is the date RC is cut -->
     <release version="2.4" date="2012-TDB-TDB" description="">
+      <action issue="IO-329" dev="ggregory" type="fix" due-to="tivv">
+        FileUtils.writeLines uses unbuffered IO.
+      </action>            
       <action issue="IO-327" dev="ggregory" type="add" due-to="ggregory">
         Add byteCountToDisplaySize(BigInteger).
       </action>            

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=1343253&r1=1343252&r2=1343253&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
13:42:40 2012
@@ -16,6 +16,7 @@
  */
 package org.apache.commons.io;
 
+import java.io.BufferedOutputStream;
 import java.io.File;
 import java.io.FileFilter;
 import java.io.FileInputStream;
@@ -2201,11 +2202,11 @@ public class FileUtils {
      * @since 2.1
      */
     public static void writeLines(File file, String encoding, Collection<?> lines,
String lineEnding, boolean append)
-        throws IOException {
-        OutputStream out = null;
+            throws IOException {
+        FileOutputStream out = null;
         try {
             out = openOutputStream(file, append);
-            IOUtils.writeLines(lines, lineEnding, out, encoding);
+            IOUtils.writeLines(lines, lineEnding, new BufferedOutputStream(out), encoding);
             out.close(); // don't swallow close Exception if copy completes normally
         } finally {
             IOUtils.closeQuietly(out);



Mime
View raw message