diff options
author | Tom Tromey <tromey@redhat.com> | 2006-03-10 23:09:23 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2006-03-10 23:09:23 +0000 |
commit | ea725d4524db8fa1bc593f5aa0e297a01ab721f3 (patch) | |
tree | 61a09663191772cb2d0e99154b48b8c6269350fa /libjava/classpath | |
parent | 21f9ec0c6ad431e25e58dee6b9e6759ab7e74003 (diff) | |
download | gcc-ea725d4524db8fa1bc593f5aa0e297a01ab721f3.zip gcc-ea725d4524db8fa1bc593f5aa0e297a01ab721f3.tar.gz gcc-ea725d4524db8fa1bc593f5aa0e297a01ab721f3.tar.bz2 |
re PR libgcj/25713 (GZIPOutputStream bad checksum)
libjava
PR libgcj/25713:
* java/util/zip/Deflater.java (flush): New method.
* sources.am, Makefile.in: Rebuilt.
* java/util/zip/DeflaterOutputStream.java: Removed.
* java/util/zip/InflaterInputStream.java: Likewise.
* java/util/zip/GZIPInputStream.java: Likewise.
* java/util/zip/GZIPOutputStream.java: Likewise.
libjava/classpath
For PR libgcj/25713:
* java/util/zip/InflaterInputStream.java (read): Replaced with
libgcj implementation.
From-SVN: r111949
Diffstat (limited to 'libjava/classpath')
-rw-r--r-- | libjava/classpath/ChangeLog.gcj | 6 | ||||
-rw-r--r-- | libjava/classpath/java/util/zip/InflaterInputStream.java | 30 |
2 files changed, 23 insertions, 13 deletions
diff --git a/libjava/classpath/ChangeLog.gcj b/libjava/classpath/ChangeLog.gcj index da0de50..f1901eb 100644 --- a/libjava/classpath/ChangeLog.gcj +++ b/libjava/classpath/ChangeLog.gcj @@ -1,3 +1,9 @@ +2006-03-10 Tom Tromey <tromey@redhat.com> + + For PR libgcj/25713: + * java/util/zip/InflaterInputStream.java (read): Replaced with + libgcj implementation. + 2006-03-08 Tom Tromey <tromey@redhat.com> PR libgcj/24183: diff --git a/libjava/classpath/java/util/zip/InflaterInputStream.java b/libjava/classpath/java/util/zip/InflaterInputStream.java index 3c37457..08c1fd7 100644 --- a/libjava/classpath/java/util/zip/InflaterInputStream.java +++ b/libjava/classpath/java/util/zip/InflaterInputStream.java @@ -1,5 +1,5 @@ /* InflaterInputStream.java - Input stream filter for decompressing - Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 + Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -186,31 +186,35 @@ public class InflaterInputStream extends FilterInputStream throw new IOException("stream closed"); if (len == 0) return 0; + if (inf.finished()) + return -1; int count = 0; - for (;;) + while (count == 0) { + if (inf.needsInput()) + fill(); try { count = inf.inflate(b, off, len); + if (count == 0) + { + if (this.len == -1) + { + // Couldn't get any more data to feed to the Inflater + return -1; + } + if (inf.needsDictionary()) + throw new ZipException("Inflater needs Dictionary"); + } } catch (DataFormatException dfe) { throw new ZipException(dfe.getMessage()); } - - if (count > 0) - return count; - - if (inf.needsDictionary() - | inf.finished()) - return -1; - else if (inf.needsInput()) - fill(); - else - throw new InternalError("Don't know what to do"); } + return count; } /** |