luyuncheng commented on code in PR #987:
URL: https://github.com/apache/lucene/pull/987#discussion_r925139050


##########
lucene/core/src/java/org/apache/lucene/codecs/lucene90/DeflateWithPresetDictCompressionMode.java:
##########
@@ -198,22 +200,25 @@ private void doCompress(byte[] bytes, int off, int len, 
DataOutput out) throws I
     }
 
     @Override
-    public void compress(byte[] bytes, int off, int len, DataOutput out) 
throws IOException {
+    public void compress(ByteBuffersDataInput buffersInput, DataOutput out) 
throws IOException {
+      final int len = (int) (buffersInput.size() - buffersInput.position());

Review Comment:
   It is right that `position()` always be 0, if caller do compress method with 
param buffersInput have been sliced. As compress method is a public interface, 
i think we need check the position for the length



-- 
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: issues-unsubscr...@lucene.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to