mirror of
https://github.com/corda/corda.git
synced 2025-01-23 12:58:35 +00:00
Keep reading in BufferedInputStream.read until in.available() <= 0
This corresponds to the documented behavior of OpenJDK's version.
This commit is contained in:
parent
20990950bb
commit
7fffba29e6
@ -58,14 +58,19 @@ public class BufferedInputStream extends InputStream {
|
|||||||
length -= remaining;
|
length -= remaining;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (length > 0) {
|
while (length > 0) {
|
||||||
int c = in.read(b, offset, length);
|
int c = in.read(b, offset, length);
|
||||||
if (c == -1) {
|
if (c == -1) {
|
||||||
if (count == 0) {
|
if (count == 0) {
|
||||||
count = -1;
|
count = -1;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
} else {
|
} else {
|
||||||
count += c;
|
count += c;
|
||||||
|
|
||||||
|
if (in.available() <= 0) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user