mirror of
https://github.com/corda/corda.git
synced 2025-01-05 20:54:13 +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) {
|
||||
return -1;
|
||||
}
|
||||
if (length-position < bufferLength) {
|
||||
bufferLength = length-position;
|
||||
int remaining = length-position;
|
||||
if (remaining < bufferLength) {
|
||||
bufferLength = remaining;
|
||||
}
|
||||
System.arraycopy(array, position, buffer, offset, bufferLength);
|
||||
position += bufferLength;
|
||||
|
Loading…
Reference in New Issue
Block a user