unpacked = (unpacked << 8) | value[valueOff++] & 0xff;
}
unpacked += PackUtil.POS_2BYTE_MAX + 1;
break;
default:
throw new WiredTigerPackingException(
"Error decoding packed value.");
}
// Check for overflow if decoding an unsigned value - since Java only
// supports signed values.
if (!signed && unpacked < 0) {
throw new WiredTigerPackingException("Overflow unpacking long.");
}
return (unpacked);
}