InflaterInputStream (read): Don't return -1 unless the infate() call didn't deliver any output.

* java/util/zip/InflaterInputStream (read): Don't return -1 unless
	the infate() call didn't deliver any output. Throw a ZipException if
	the needsDictionary() call returns true.
	* java/io/ByteArrayInputStream (read): Remove redundant bounds checks.
	* java/io/InputStreamReader: Use the default buffer size for the
	contained BufferedInputStream.

From-SVN: r37846
This commit is contained in:
Bryce McKinlay 2000-11-29 10:06:03 +00:00 committed by Bryce McKinlay
parent 172c38bb69
commit d02bc1fb25
4 changed files with 18 additions and 15 deletions

View file

@ -72,9 +72,6 @@ public class ByteArrayInputStream extends InputStream
public synchronized int read()
{
if (pos < 0)
throw new ArrayIndexOutOfBoundsException(pos);
if (pos < count)
return ((int) buf[pos++]) & 0xFF;
return -1;
@ -82,10 +79,6 @@ public class ByteArrayInputStream extends InputStream
public synchronized int read(byte[] b, int off, int len)
{
/* Don't need to check pos value, arraycopy will check it. */
if (off < 0 || len < 0 || off + len > b.length)
throw new ArrayIndexOutOfBoundsException();
if (pos >= count)
return -1;