mirror of
https://github.com/apple/foundationdb.git
synced 2025-06-02 03:12:12 +08:00
Merge pull request #2723 from ajbeamon/java-fix-little-endian-unpack
Fix: Java directory layer was unpacking little endian numbers without properly handling signs
This commit is contained in:
commit
6a6b89b258
@ -817,9 +817,9 @@ public class DirectoryLayer implements Directory {
|
||||
|
||||
private static long unpackLittleEndian(byte[] bytes) {
|
||||
assert bytes.length == 8;
|
||||
int value = 0;
|
||||
long value = 0;
|
||||
for(int i = 0; i < 8; ++i) {
|
||||
value += (bytes[i] << (i * 8));
|
||||
value += (Byte.toUnsignedLong(bytes[i]) << (i * 8));
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user