Return-Path: X-Original-To: apmail-commons-commits-archive@minotaur.apache.org Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8CDEA97D3 for ; Mon, 28 May 2012 13:43:04 +0000 (UTC) Received: (qmail 28634 invoked by uid 500); 28 May 2012 13:43:04 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 28577 invoked by uid 500); 28 May 2012 13:43:04 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 28569 invoked by uid 99); 28 May 2012 13:43:04 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 May 2012 13:43:04 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 May 2012 13:43:01 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 0976A23888CD for ; Mon, 28 May 2012 13:42:41 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@commons.apache.org From: ggregory@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120528134241.0976A23888CD@eris.apache.org> 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 type attribute can be add,u + + FileUtils.writeLines uses unbuffered IO. + Add byteCountToDisplaySize(BigInteger). 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);