ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r802489 - in /ant/sandbox/antlibs/compress/trunk/src/main/org/apache/ant/compress/resources: CommonsCompressArchiveResource.java CommonsCompressArchiveScanner.java
Date Sun, 09 Aug 2009 05:36:08 GMT
Author: bodewig
Date: Sun Aug  9 05:36:08 2009
New Revision: 802489

URL: http://svn.apache.org/viewvc?rev=802489&view=rev
Log:
improve performance by buffereing

Modified:
    ant/sandbox/antlibs/compress/trunk/src/main/org/apache/ant/compress/resources/CommonsCompressArchiveResource.java
    ant/sandbox/antlibs/compress/trunk/src/main/org/apache/ant/compress/resources/CommonsCompressArchiveScanner.java

Modified: ant/sandbox/antlibs/compress/trunk/src/main/org/apache/ant/compress/resources/CommonsCompressArchiveResource.java
URL: http://svn.apache.org/viewvc/ant/sandbox/antlibs/compress/trunk/src/main/org/apache/ant/compress/resources/CommonsCompressArchiveResource.java?rev=802489&r1=802488&r2=802489&view=diff
==============================================================================
--- ant/sandbox/antlibs/compress/trunk/src/main/org/apache/ant/compress/resources/CommonsCompressArchiveResource.java
(original)
+++ ant/sandbox/antlibs/compress/trunk/src/main/org/apache/ant/compress/resources/CommonsCompressArchiveResource.java
Sun Aug  9 05:36:08 2009
@@ -17,6 +17,7 @@
  */
 package org.apache.ant.compress.resources;
 
+import java.io.BufferedInputStream;
 import java.io.File;
 import java.io.InputStream;
 import java.io.OutputStream;
@@ -81,7 +82,8 @@
             return ((Resource) getCheckedRef()).getInputStream();
         }
         Resource archive = getArchive();
-        final ArchiveInputStream i = getArchiveStream(archive.getInputStream());
+        final ArchiveInputStream i =
+            getArchiveStream(new BufferedInputStream(archive.getInputStream()));
         ArchiveEntry ae = null;
         while ((ae = i.getNextEntry()) != null) {
             if (ae.getName().equals(getName())) {

Modified: ant/sandbox/antlibs/compress/trunk/src/main/org/apache/ant/compress/resources/CommonsCompressArchiveScanner.java
URL: http://svn.apache.org/viewvc/ant/sandbox/antlibs/compress/trunk/src/main/org/apache/ant/compress/resources/CommonsCompressArchiveScanner.java?rev=802489&r1=802488&r2=802489&view=diff
==============================================================================
--- ant/sandbox/antlibs/compress/trunk/src/main/org/apache/ant/compress/resources/CommonsCompressArchiveScanner.java
(original)
+++ ant/sandbox/antlibs/compress/trunk/src/main/org/apache/ant/compress/resources/CommonsCompressArchiveScanner.java
Sun Aug  9 05:36:08 2009
@@ -18,6 +18,7 @@
 
 package org.apache.ant.compress.resources;
 
+import java.io.BufferedInputStream;
 import java.io.InputStream;
 import java.io.IOException;
 import java.util.Map;
@@ -73,7 +74,9 @@
 
         try {
             try {
-                ai = getArchiveStream(src.getInputStream(), encoding);
+                ai = getArchiveStream(new BufferedInputStream(src
+                                                              .getInputStream()),
+                                      encoding);
             } catch (IOException ex) {
                 throw new BuildException("problem opening " + src, ex);
             }



Mime
View raw message