I suggest the following patch to skip more than 2k bytes:
2004-04-05 IngoProetel <[EMAIL PROTECTED]>
* java/util/zip/InflaterInputStream.java (skip): Copied implementation
from java.io.InputStream.
ingo
--
Ingo Pr�tel [EMAIL PROTECTED]
aicas GmbH http://www.aicas.com
Haid-und-Neu-Str. 18 phone +49 721 663 968-32
76131 Karlsruhe fax +49 721 663 968-93
Germany
Index: java/util/zip/InflaterInputStream.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/util/zip/InflaterInputStream.java,v
retrieving revision 1.10
diff -u -r1.10 InflaterInputStream.java
--- java/util/zip/InflaterInputStream.java 4 Nov 2003 10:04:16 -0000 1.10
+++ java/util/zip/InflaterInputStream.java 5 Apr 2004 15:41:10 -0000
@@ -215,13 +215,23 @@
*/
public long skip(long n) throws IOException
{
- if (n < 0)
- throw new IllegalArgumentException();
- int len = 2048;
- if (n < len)
- len = (int) n;
- byte[] tmp = new byte[len];
- return (long) read(tmp);
+ // Implementation copied from InputStream
+ // Throw away n bytes by reading them into a temp byte[].
+ // Limit the temp array to 2Kb so we don't grab too much memory.
+ final int buflen = n > 2048 ? 2048 : (int) n;
+ byte[] tmpbuf = new byte[buflen];
+ final long origN = n;
+
+ while (n > 0L)
+ {
+ int numread = read(tmpbuf, 0, n > buflen ? buflen : (int) n);
+ if (numread <= 0)
+ break;
+ n -= numread;
+ }
+
+ return origN - n;
+
}
/**
_______________________________________________
Classpath mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/classpath