uschindler commented on code in PR #1034:
URL: https://github.com/apache/lucene/pull/1034#discussion_r923642311
##########
lucene/core/src/java/org/apache/lucene/store/ByteBuffersDataOutput.java:
##########
@@ -309,6 +309,30 @@ public byte[] toArrayCopy() {
return arr;
}
+ @Override
+ public void copyBytes(DataInput input, long numBytes) throws IOException {
+ assert numBytes >= 0 : "numBytes=" + numBytes;
+ int length = (int) numBytes;
+ while (length > 0) {
+ if (!currentBlock.hasRemaining()) {
+ appendBlock();
+ }
+ if (currentBlock.isDirect()) {
Review Comment:
this should be `false == currentBlock.hasArray()`
This is because direct and has array are somehow opposites, but thats just
an implementation details. So whenever a buffer does not have an array we need
to fallback to the super method.
--
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]