From bb0cd3e180349747855616204e6f96f44fc7d9c0 Mon Sep 17 00:00:00 2001 From: konsoletyper Date: Sun, 25 Jan 2015 12:05:17 +0400 Subject: [PATCH] Fix bug in InputStreamReader --- .../java/org/teavm/classlib/java/io/TInputStreamReader.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/teavm-classlib/src/main/java/org/teavm/classlib/java/io/TInputStreamReader.java b/teavm-classlib/src/main/java/org/teavm/classlib/java/io/TInputStreamReader.java index 88308ff6b..891fb473b 100644 --- a/teavm-classlib/src/main/java/org/teavm/classlib/java/io/TInputStreamReader.java +++ b/teavm-classlib/src/main/java/org/teavm/classlib/java/io/TInputStreamReader.java @@ -75,6 +75,9 @@ public class TInputStreamReader extends TReader { @Override public int read(char[] cbuf, int off, int len) throws TIOException { + if (eof && outBuffer.end()) { + return -1; + } CharBuffer wrapBuffer = new CharBuffer(cbuf, off, off + len); while (!wrapBuffer.end()) { wrapBuffer.put(outBuffer);