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:
parent
172c38bb69
commit
d02bc1fb25
4 changed files with 18 additions and 15 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue