mirror of
https://github.com/corda/corda.git
synced 2025-01-07 13:38:47 +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;
|
||||
}
|
||||
|
||||
if (length > 0) {
|
||||
while (length > 0) {
|
||||
int c = in.read(b, offset, length);
|
||||
if (c == -1) {
|
||||
if (count == 0) {
|
||||
count = -1;
|
||||
}
|
||||
break;
|
||||
} else {
|
||||
count += c;
|
||||
|
||||
if (in.available() <= 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user