summaryrefslogtreecommitdiff
path: root/libjava
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2004-10-21 19:32:51 +0000
committerTom Tromey <tromey@gcc.gnu.org>2004-10-21 19:32:51 +0000
commitc28fdf712f5cbe81fb36e618f4fad9f79691be44 (patch)
tree2eb555294af2bb33a9c09ac8186dfde254e6469a /libjava
parentb228bf7fd20f936d51d81a48042575f88e7e9742 (diff)
downloadgcc-c28fdf712f5cbe81fb36e618f4fad9f79691be44.tar.gz
InflaterInputStream.java (fill): Don't throw an exception if we hit EOF of `in'.
* java/util/zip/InflaterInputStream.java (fill): Don't throw an exception if we hit EOF of `in'. (read): Handle case where inflating returns -1. From-SVN: r89395
Diffstat (limited to 'libjava')
-rw-r--r--libjava/ChangeLog6
-rw-r--r--libjava/java/util/zip/InflaterInputStream.java12
2 files changed, 10 insertions, 8 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index 3940353f2c7..dbbbe010626 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,9 @@
+2004-10-21 Tom Tromey <tromey@redhat.com>
+
+ * java/util/zip/InflaterInputStream.java (fill): Don't throw an
+ exception if we hit EOF of `in'.
+ (read): Handle case where inflating returns -1.
+
2004-10-21 Ulrich Weigand <uweigand@de.ibm.com>
* gnu/java/nio/channels/natFileChannelPosix.cc
diff --git a/libjava/java/util/zip/InflaterInputStream.java b/libjava/java/util/zip/InflaterInputStream.java
index 3676a2cdb5d..bfe93bd152c 100644
--- a/libjava/java/util/zip/InflaterInputStream.java
+++ b/libjava/java/util/zip/InflaterInputStream.java
@@ -152,10 +152,8 @@ public class InflaterInputStream extends FilterInputStream
len = in.read(buf, 0, buf.length);
- if (len < 0)
- throw new ZipException("Deflated stream ends early.");
-
- inf.setInput(buf, 0, len);
+ if (len >= 0)
+ inf.setInput(buf, 0, len);
}
/**
@@ -188,7 +186,7 @@ public class InflaterInputStream extends FilterInputStream
return -1;
int count = 0;
- for (;;)
+ while (count == 0)
{
if (inf.needsInput())
fill();
@@ -211,10 +209,8 @@ public class InflaterInputStream extends FilterInputStream
{
throw new ZipException(dfe.getMessage());
}
-
- if (count > 0)
- return count;
}
+ return count;
}
/**