Skip to content

Commit 0fea784

Browse files
committed
Use unsigned byte value to generate prefix
1 parent ac86eed commit 0fea784

File tree

1 file changed

+1
-1
lines changed
  • common/unsafe/src/main/java/org/apache/spark/unsafe/types

1 file changed

+1
-1
lines changed

common/unsafe/src/main/java/org/apache/spark/unsafe/types/ByteArray.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public static long getPrefix(byte[] bytes) {
4444
final int minLen = Math.min(bytes.length, 8);
4545
long p = 0;
4646
for (int i = 0; i < minLen; ++i) {
47-
p |= (128L + Platform.getByte(bytes, Platform.BYTE_ARRAY_OFFSET + i))
47+
p |= ((long)Platform.getByte(bytes, Platform.BYTE_ARRAY_OFFSET + i) & 0xff)
4848
<< (56 - 8 * i);
4949
}
5050
return p;

0 commit comments

Comments
 (0)