Beispiel #1
0
 public object Read(ProtoReader reader)
 {
     ulong raw = reader.ReadVarint64();
     unsafe
     {
         return *((double*)&raw);
     }
 }
Beispiel #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());
     }
 }
Beispiel #3
0
 public object Read(ProtoReader reader)
 {
     return (ulong)reader.ReadVarint64();
 }
Beispiel #4
0
 public object Read(ProtoReader reader)
 {
     return new TimeSpan((long)reader.ReadVarint64());
 }