Fix: directory layer was unpacking little endian numbers without properly handling signs.
This commit is contained in:
parent
3c20a75fa0
commit
7fbdd4e4fe
|
@ -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 += ((long)bytes[i]&0xFF << (i * 8));
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue