mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 16:14:10 -08:00
Fix bug in InputStream.read implementation
This commit is contained in:
parent
7f33f64d25
commit
5c189cfe15
|
@ -36,7 +36,7 @@ public abstract class TInputStream extends TObject implements TCloseable {
|
||||||
for (int i = 0; i < len; ++i) {
|
for (int i = 0; i < len; ++i) {
|
||||||
int bt = read();
|
int bt = read();
|
||||||
if (bt < 0) {
|
if (bt < 0) {
|
||||||
return i;
|
return i == 0 ? -1 : i;
|
||||||
}
|
}
|
||||||
b[off++] = (byte)bt;
|
b[off++] = (byte)bt;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user