ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r805274 - /ant/sandbox/antlibs/compress/trunk/src/main/org/apache/ant/compress/taskdefs/ArchiveBase.java
Date Tue, 18 Aug 2009 04:31:33 GMT
Author: bodewig
Date: Tue Aug 18 04:31:32 2009
New Revision: 805274

URL: http://svn.apache.org/viewvc?rev=805274&view=rev
Log:
take advantage of a ACC utility class

Modified:
    ant/sandbox/antlibs/compress/trunk/src/main/org/apache/ant/compress/taskdefs/ArchiveBase.java

Modified: ant/sandbox/antlibs/compress/trunk/src/main/org/apache/ant/compress/taskdefs/ArchiveBase.java
URL: http://svn.apache.org/viewvc/ant/sandbox/antlibs/compress/trunk/src/main/org/apache/ant/compress/taskdefs/ArchiveBase.java?rev=805274&r1=805273&r2=805274&view=diff
==============================================================================
--- ant/sandbox/antlibs/compress/trunk/src/main/org/apache/ant/compress/taskdefs/ArchiveBase.java
(original)
+++ ant/sandbox/antlibs/compress/trunk/src/main/org/apache/ant/compress/taskdefs/ArchiveBase.java
Tue Aug 18 04:31:32 2009
@@ -46,6 +46,7 @@
 import org.apache.commons.compress.archivers.zip.ExtraFieldUtils;
 import org.apache.commons.compress.archivers.zip.ZipExtraField;
 import org.apache.commons.compress.archivers.zip.ZipShort;
+import org.apache.commons.compress.utils.IOUtils;
 
 import org.apache.tools.ant.BuildException;
 import org.apache.tools.ant.Project;
@@ -210,13 +211,7 @@
                     InputStream in = null;
                     try {
                         in = src[i].getResource().getInputStream();
-
-                        byte[] buffer = new byte[8192];
-                        int count = 0;
-                        do {
-                            out.write(buffer, 0, count);
-                            count = in.read(buffer, 0, buffer.length);
-                        } while (count != -1);
+                        IOUtils.copy(in, out);
                     } finally {
                         fu.close(in);
                     }



Mime
View raw message