Пример #1
0
 public object Read(ProtoReader reader)
 {
     uint raw = reader.ReadVarint();
     unsafe
     {
         return *((float*)&raw);
     }
 }
Пример #2
0
 public object Read(ProtoReader reader)
 {
     switch (this.typeCode)
     {
         case TypeCode.Byte:
         case TypeCode.SByte:
         case TypeCode.Int16:
         case TypeCode.Int32:
         case TypeCode.UInt16:
         case TypeCode.UInt32:
             return Enum.ToObject(enumType, reader.ReadVarint());
         case TypeCode.Int64:
         case TypeCode.UInt64:
         default:
             return Enum.ToObject(enumType, reader.ReadVarint64());
     }
 }
Пример #3
0
 public object Read(ProtoReader reader)
 {
     return (int)reader.ReadVarint();
 }
Пример #4
0
 public object Read(ProtoReader reader)
 {
     uint value = reader.ReadVarint();
     return value == 1;
 }