diff options
author | Tom Tromey <tromey@redhat.com> | 2001-08-06 22:01:32 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2001-08-06 22:01:32 +0000 |
commit | 012ca3e055dbc6ce0b9aa33d095e63ff3baba1b0 (patch) | |
tree | 0d3c2ef2061d47e27ef888edc285f2e49a586b7b /libjava/java/io | |
parent | 6b6f7231791e4b5479e95b1b5716cd02c7ba1856 (diff) | |
download | gcc-012ca3e055dbc6ce0b9aa33d095e63ff3baba1b0.zip gcc-012ca3e055dbc6ce0b9aa33d095e63ff3baba1b0.tar.gz gcc-012ca3e055dbc6ce0b9aa33d095e63ff3baba1b0.tar.bz2 |
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
Diffstat (limited to 'libjava/java/io')
-rw-r--r-- | libjava/java/io/InputStreamReader.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libjava/java/io/InputStreamReader.java b/libjava/java/io/InputStreamReader.java index 45fd598..fff979c 100644 --- a/libjava/java/io/InputStreamReader.java +++ b/libjava/java/io/InputStreamReader.java @@ -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; |