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:
parent
6b6f723179
commit
012ca3e055
2 changed files with 8 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue