FastByteArrayInputStream returns correct count from read(byte[])
Issue: SPR-14209
This commit is contained in:
@@ -421,7 +421,8 @@ public class FastByteArrayOutputStream extends OutputStream {
|
||||
System.arraycopy(this.currentBuffer, this.nextIndexInCurrentBuffer, b, off, bytesToCopy);
|
||||
this.totalBytesRead += bytesToCopy;
|
||||
this.nextIndexInCurrentBuffer += bytesToCopy;
|
||||
return (bytesToCopy + read(b, off + bytesToCopy, len - bytesToCopy));
|
||||
int remaining = read(b, off + bytesToCopy, len - bytesToCopy);
|
||||
return bytesToCopy + Math.max(remaining, 0);
|
||||
}
|
||||
else {
|
||||
if (this.buffersIterator.hasNext()) {
|
||||
|
||||
Reference in New Issue
Block a user