Here is a patch that should speed up the ZipInputStream implementation.

Sun Feb 13 Moses DeJong  <[EMAIL PROTECTED]>

        * libraries/javalib/java/util/zip/InflaterInputStream.java:
        Changed call to read() in the skip() method so that an
        array of 1 byte is not allocated each time through the loop.
Index: libraries/javalib/java/util/zip/InflaterInputStream.java
===================================================================
RCS file: /cvs/kaffe/kaffe/libraries/javalib/java/util/zip/InflaterInputStream.java,v
retrieving revision 1.3
diff -u -r1.3 InflaterInputStream.java
--- libraries/javalib/java/util/zip/InflaterInputStream.java    1999/03/10 21:26:02    
 1.3
+++ libraries/javalib/java/util/zip/InflaterInputStream.java    2000/02/13 23:56:20
@@ -79,8 +79,10 @@
 public long skip(long n) throws IOException {
        // This is a terribly inefficient way to skip ...
        long cnt;
+       byte[] b = new byte[1];
+
        for (cnt = 0; cnt < n; cnt++) {
-               int r = read();
+               int r = read(b, 0, 1);
                if (r == -1) {
                        break;
                }

Reply via email to