예제 #1
0
        public double ReadVarLong()
        {
            byte _loc_3 = 0;
            Int64 result = new Int64();
            uint _loc_4 = 0;
            while (true)
            {

                _loc_3 = this.ReadByte();
                if (_loc_4 == 28)
                {
                    break;
                }
                else if (_loc_3 >= 128)
                {
                    result.low = Convert.ToUInt32(result.low | Convert.ToUInt32(_loc_3 & 127) << Convert.ToInt32(_loc_4));
                }
                else
                {
                    result.low = Convert.ToUInt32(result.low | Convert.ToUInt32(_loc_3) << Convert.ToInt32(_loc_4));
                    return result.toNumber();
                }
                _loc_4 = _loc_4 + 7;
            }
            if (_loc_3 >= 128)
            {
                _loc_3 = (byte)(_loc_3 & 127);
                result.low = Convert.ToUInt32(result.low | Convert.ToUInt32(_loc_3) << Convert.ToInt32(_loc_4));
                result.high = Convert.ToUInt32(_loc_3) >> 4;
            }
            else
            {
                result.low = Convert.ToUInt32(result.low | Convert.ToUInt32(_loc_3) << Convert.ToInt32(_loc_4));
                result.high = Convert.ToUInt32(_loc_3) >> 4;
                return result.toNumber();
            }
            _loc_4 = 3;
            while (true)
            {

                _loc_3 = ReadByte();
                if (_loc_4 < 32)
                {
                    if (_loc_3 >= 128)
                    {
                        result.high = result.high | Convert.ToUInt32(_loc_3 & 127) << Convert.ToInt32(_loc_4);
                    }
                    else
                    {
                        result.high = result.high | Convert.ToUInt32(_loc_3) << Convert.ToInt32(_loc_4);
                        break;
                    }
                }
                _loc_4 = _loc_4 + 7;
            }
            return result.toNumber();
        }