InputStreamReader.java (refill): Only call refill on BufferedInputStream when appropriate constraints are met.

* java/io/InputStreamReader.java (refill): Only call refill on
	BufferedInputStream when appropriate constraints are met.

From-SVN: r44675
This commit is contained in:
Tom Tromey 2001-08-06 22:01:32 +00:00 committed by Tom Tromey
parent 6b6f723179
commit 012ca3e055
2 changed files with 8 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2001-08-06 Tom Tromey <tromey@redhat.com>
* java/io/InputStreamReader.java (refill): Only call refill on
BufferedInputStream when appropriate constraints are met.
2001-08-05 Tom Tromey <tromey@redhat.com>
* java/io/StringWriter.java: Merged with Classpath.

View File

@ -149,7 +149,9 @@ public class InputStreamReader extends Reader
// We have knowledge of the internals of BufferedInputStream
// here. Eww.
in.mark (0);
boolean r = in.refill ();
// BufferedInputStream.refill() can only be called when
// `pos>=count'.
boolean r = in.pos < in.count || in.refill ();
in.reset ();
if (! r)
return false;