Fix: directory layer was unpacking little endian numbers without properly handling signs.

This commit is contained in:
A.J. Beamon 2020-02-21 15:42:34 -08:00
parent 3c20a75fa0
commit 7fbdd4e4fe
1 changed files with 2 additions and 2 deletions

View File

@ -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;
}