summaryrefslogtreecommitdiffstats
path: root/libjava/java/util/zip/InflaterInputStream.java
diff options
context:
space:
mode:
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2002-06-15 18:31:13 +0000
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2002-06-15 18:31:13 +0000
commitde303781eb6494e41b9a2807a02a8d12716f0087 (patch)
tree5bc4d8b0019a7c9f9259e1a51e3833b92c21db21 /libjava/java/util/zip/InflaterInputStream.java
parenta0af33ad8a5bddd049fdf7b5a35717785cd173af (diff)
downloadppe42-gcc-de303781eb6494e41b9a2807a02a8d12716f0087.tar.gz
ppe42-gcc-de303781eb6494e41b9a2807a02a8d12716f0087.zip
* java/util/zip/InflaterInputStream.java (read): Loop if data has
been read but none output by inflater. * java/util/zip/natDeflater.cc (reset): Set is_finished. * java/util/zip/natInflater.cc (reset): Set dist_needed and is_finished. * java/util/zip/ZipOutputStream.java: Replaced with Classpath version. * java/util/zip/ZipFile.java: Replaced with Classpath version. * java/util/zip/ZipEntry.java: Replaced with Classpath version. * java/util/zip/ZipInputStream.java: Replaced with Classpath version. * java/util/zip/ZipConstants.java: Replaced with Classpath version. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@54653 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java/util/zip/InflaterInputStream.java')
-rw-r--r--libjava/java/util/zip/InflaterInputStream.java39
1 files changed, 23 insertions, 16 deletions
diff --git a/libjava/java/util/zip/InflaterInputStream.java b/libjava/java/util/zip/InflaterInputStream.java
index dc20e745956..5aac73d7e5a 100644
--- a/libjava/java/util/zip/InflaterInputStream.java
+++ b/libjava/java/util/zip/InflaterInputStream.java
@@ -1,5 +1,5 @@
/* InflaterInputStream.java - Input stream filter for decompressing
- Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -92,23 +92,30 @@ public class InflaterInputStream extends FilterInputStream
throw new IOException ("stream closed");
if (inf.finished())
return -1;
- if (inf.needsInput())
- fill ();
- int count;
- try
+
+ int count = 0;
+ while (count == 0)
{
- count = inf.inflate(buf, off, len);
- if (count == 0)
+ if (inf.needsInput())
+ fill ();
+ try
{
- if (this.len == -1)
- return -1; // Couldn't get any more data to feed to the Inflater
- if (inf.needsDictionary())
- throw new ZipException ("Inflater needs Dictionary");
- }
- }
- catch (DataFormatException dfe)
- {
- throw new ZipException (dfe.getMessage());
+ count = inf.inflate(buf, 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());
+ }
}
return count;
}
OpenPOWER on IntegriCloud