瀏覽代碼

Make Murmur3Hasher#update public (#117961) (#118002)

Closes #117883
Nhat Nguyen 10 月之前
父節點
當前提交
edf4419780
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. 6 1
      server/src/main/java/org/elasticsearch/common/hash/Murmur3Hasher.java

+ 6 - 1
server/src/main/java/org/elasticsearch/common/hash/Murmur3Hasher.java

@@ -40,7 +40,12 @@ public class Murmur3Hasher {
         update(inputBytes, 0, inputBytes.length);
         update(inputBytes, 0, inputBytes.length);
     }
     }
 
 
-    private void update(byte[] inputBytes, int offset, int length) {
+    /**
+     * Similar to {@link #update(byte[])}, but processes a specific portion of the input bytes
+     * starting from the given {@code offset} for the specified {@code length}.
+     * @see #update(byte[])
+     */
+    public void update(byte[] inputBytes, int offset, int length) {
         if (remainderLength + length >= remainder.length) {
         if (remainderLength + length >= remainder.length) {
             if (remainderLength > 0) {
             if (remainderLength > 0) {
                 // fill rest of remainder from inputBytes and hash remainder
                 // fill rest of remainder from inputBytes and hash remainder