mirror of
https://github.com/corda/corda.git
synced 2025-01-07 13:38:47 +00:00
Minor optimization for ByteArrayInputStream
This commit is contained in:
parent
907ce57975
commit
b85c643251
@ -23,8 +23,9 @@ public class ByteArrayInputStream extends InputStream {
|
|||||||
if (position < length) {
|
if (position < length) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (length-position < bufferLength) {
|
int remaining = length-position;
|
||||||
bufferLength = length-position;
|
if (remaining < bufferLength) {
|
||||||
|
bufferLength = remaining;
|
||||||
}
|
}
|
||||||
System.arraycopy(array, position, buffer, offset, bufferLength);
|
System.arraycopy(array, position, buffer, offset, bufferLength);
|
||||||
position += bufferLength;
|
position += bufferLength;
|
||||||
|
Loading…
Reference in New Issue
Block a user