Commit c28fdf71 by Tom Tromey Committed by Tom Tromey

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
parent b228bf7f
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
......
......@@ -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;
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment