harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From regi...@apache.org
Subject svn commit: r999286 - /harmony/enhanced/java/trunk/jdktools/modules/jdktools/src/main/java/org/apache/harmony/tools/jar/Main.java
Date Tue, 21 Sep 2010 09:20:06 GMT
Author: regisxu
Date: Tue Sep 21 09:20:04 2010
New Revision: 999286

URL: http://svn.apache.org/viewvc?rev=999286&view=rev
Log:
Improve performance of extract jar file by reading/writing bulk of bytes instead of one byte.

Modified:
    harmony/enhanced/java/trunk/jdktools/modules/jdktools/src/main/java/org/apache/harmony/tools/jar/Main.java

Modified: harmony/enhanced/java/trunk/jdktools/modules/jdktools/src/main/java/org/apache/harmony/tools/jar/Main.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/trunk/jdktools/modules/jdktools/src/main/java/org/apache/harmony/tools/jar/Main.java?rev=999286&r1=999285&r2=999286&view=diff
==============================================================================
--- harmony/enhanced/java/trunk/jdktools/modules/jdktools/src/main/java/org/apache/harmony/tools/jar/Main.java
(original)
+++ harmony/enhanced/java/trunk/jdktools/modules/jdktools/src/main/java/org/apache/harmony/tools/jar/Main.java
Tue Sep 21 09:20:04 2010
@@ -212,9 +212,10 @@ public class Main {
                 File f = new File(ze.getName());
                 f.createNewFile();
                 FileOutputStream fos = new FileOutputStream(f);
-                int i;
-                while ((i = zis.read()) != -1) {
-                    fos.write(i);
+                int c;
+                byte[] bs = new byte[1024];
+                while ((c = zis.read(bs)) != -1) {
+                    fos.write(bs, 0, c);
                 }
                 fos.close();
                 if (verboseFlag) {



Mime
View raw message