HoustonPutman commented on code in PR #3341:
URL: https://github.com/apache/solr/pull/3341#discussion_r2070703403
##########
solr/solrj/src/java/org/apache/solr/common/util/ResumableInputStream.java:
##########
@@ -84,6 +83,34 @@ public int read(boolean isRetry) throws IOException {
return val;
}
+ @Override
+ public int read(byte[] b, int off, int len) throws IOException {
+ return read(b, off, len, false);
+ }
+
+ public int read(byte[] b, int off, int len, boolean isRetry) throws
IOException {
+ if (delegate == null) {
+ delegate = nextInputStreamSupplier.apply(bytesRead);
+ }
+ int readLen;
+ try {
+ readLen = delegate.read(b, off, len);
+ if (len >= 0) {
Review Comment:
Yep, dumb miss.
And unfortunately this is tested:
```java
// test both read() and read(buffer, off, len)
if (random().nextBoolean()) {
done = input.read() == -1;
if (!done) {
byteCount++;
}
} else {
int readLen = input.read(buffer, 0, random().nextInt(maxBuffer) + 1);
if (readLen > 0) {
byteCount += readLen;
} else {
// We are done when readLen = -1
done = true;
}
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]