diff options
| author | Tom Tromey <tromey@redhat.com> | 2006-03-11 18:00:55 +0000 |
|---|---|---|
| committer | Tom Tromey <tromey@redhat.com> | 2006-03-11 18:00:55 +0000 |
| commit | 776a0bfe33a4d13ec7fe3078782b83a5ebf6748e (patch) | |
| tree | 9f3d0d76f7825f60a5a1925f244e8a1b47430865 /java/util/zip/InflaterInputStream.java | |
| parent | ae8e87e453d8e5721cd6f73380fce54eed57372b (diff) | |
| download | classpath-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.java | 46 |
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; } /** |
