public static function bytesToSLong($bytes, $offset, $endian)
    {
        $n = self::bytesToLong($bytes, $offset, $endian);
        if ($n > 2147483647) {
            return $n - 4294967296;
        } else {
            return $n;
        }
    }