diff options
author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-03-10 23:09:23 +0000 |
---|---|---|
committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-03-10 23:09:23 +0000 |
commit | b3c9e878a88866f035822406f53ae9f5b165ce96 (patch) | |
tree | 61a09663191772cb2d0e99154b48b8c6269350fa /libjava/classpath/java | |
parent | d217355ec70102e776f09159d3831277b729affd (diff) | |
download | gcc-b3c9e878a88866f035822406f53ae9f5b165ce96.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@111949 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/classpath/java')
-rw-r--r-- | libjava/classpath/java/util/zip/InflaterInputStream.java | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/libjava/classpath/java/util/zip/InflaterInputStream.java b/libjava/classpath/java/util/zip/InflaterInputStream.java index 3c374570602..08c1fd75a0b 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; } /** |