summaryrefslogtreecommitdiff
path: root/java/util/zip/InflaterInputStream.java
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2006-03-11 18:00:55 +0000
committerTom Tromey <tromey@redhat.com>2006-03-11 18:00:55 +0000
commit776a0bfe33a4d13ec7fe3078782b83a5ebf6748e (patch)
tree9f3d0d76f7825f60a5a1925f244e8a1b47430865 /java/util/zip/InflaterInputStream.java
parentae8e87e453d8e5721cd6f73380fce54eed57372b (diff)
downloadclasspath-776a0bfe33a4d13ec7fe3078782b83a5ebf6748e.tar.gz
* java/util/zip/InflaterInputStream.java: Reverted previous
patch.
Diffstat (limited to 'java/util/zip/InflaterInputStream.java')
-rw-r--r--java/util/zip/InflaterInputStream.java46
1 files changed, 21 insertions, 25 deletions
diff --git a/java/util/zip/InflaterInputStream.java b/java/util/zip/InflaterInputStream.java
index a42e0361b..3c3745706 100644
--- a/java/util/zip/InflaterInputStream.java
+++ b/java/util/zip/InflaterInputStream.java
@@ -186,35 +186,31 @@ public class InflaterInputStream extends FilterInputStream
throw new IOException("stream closed");
if (len == 0)
return 0;
- if (inf.finished())
- return - 1;
int count = 0;
- while (count == 0)
+ for (;;)
{
- if (inf.needsInput())
- fill();
-
- try
- {
- count = inf.inflate(b, off, len);
- }
- catch (DataFormatException dfe)
- {
- throw new ZipException(dfe.getMessage());
- }
- 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");
- }
+
+ try
+ {
+ count = inf.inflate(b, off, len);
+ }
+ 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;
}
/**