public static readSignedLShort ( $str ) : integer | ||
$str | ||
return | integer |
public static function readSignedLShort($str)
{
if (PHP_INT_SIZE === 8) {
return unpack("v", $str)[1] << 48 >> 48;
} else {
return unpack("v", $str)[1] << 16 >> 16;
}
}
public function getLShort($signed = true) { return $signed ? Binary::readSignedLShort($this->get(2)) : Binary::readLShort($this->get(2)); }