Fix bug in InputStreamReader

This commit is contained in:
konsoletyper 2015-01-25 12:05:17 +04:00
parent b71ba395fd
commit bb0cd3e180

View File

@ -75,6 +75,9 @@ public class TInputStreamReader extends TReader {
@Override @Override
public int read(char[] cbuf, int off, int len) throws TIOException { 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); CharBuffer wrapBuffer = new CharBuffer(cbuf, off, off + len);
while (!wrapBuffer.end()) { while (!wrapBuffer.end()) {
wrapBuffer.put(outBuffer); wrapBuffer.put(outBuffer);