public static void RegisterCodec <T>(BitStreamCodec.SerializerHandler serializer, BitStreamCodec.DeserializerHandler deserializer)
 {
     if (!BitStreamCodec.dictionary_0.ContainsKey(typeof(T)) && BitStreamCodec.byte_0 < 128)
     {
         BitStreamCodec.RegisterCodec(typeof(T), BitStreamCodec.byte_0 += 1, serializer, deserializer);
         return;
     }
 }
 static BitStreamCodec()
 {
     BitStreamCodec.dictionary_0 = new Dictionary <Type, BitStreamCodec>();
     BitStreamCodec.byte_0       = 16;
     BitStreamCodec.RegisterCodec <object>(BitStreamTypeCode.Undefined, new BitStreamCodec.SerializerHandler(BitStreamCodec.smethod_0), new BitStreamCodec.DeserializerHandler(BitStreamCodec.smethod_1));
     BitStreamCodec.RegisterCodec <bool>(BitStreamTypeCode.Boolean, new BitStreamCodec.SerializerHandler(BitStreamCodec.smethod_2), new BitStreamCodec.DeserializerHandler(BitStreamCodec.smethod_3));
     BitStreamCodec.RegisterCodec <char>(BitStreamTypeCode.Char, new BitStreamCodec.SerializerHandler(BitStreamCodec.smethod_4), new BitStreamCodec.DeserializerHandler(BitStreamCodec.smethod_5));
     BitStreamCodec.RegisterCodec <byte>(BitStreamTypeCode.Byte, new BitStreamCodec.SerializerHandler(BitStreamCodec.smethod_6), new BitStreamCodec.DeserializerHandler(BitStreamCodec.smethod_7));
     BitStreamCodec.RegisterCodec <sbyte>(BitStreamTypeCode.SByte, new BitStreamCodec.SerializerHandler(BitStreamCodec.smethod_8), new BitStreamCodec.DeserializerHandler(BitStreamCodec.smethod_9));
     BitStreamCodec.RegisterCodec <short>(BitStreamTypeCode.Int16, new BitStreamCodec.SerializerHandler(BitStreamCodec.smethod_10), new BitStreamCodec.DeserializerHandler(BitStreamCodec.smethod_11));
     BitStreamCodec.RegisterCodec <ushort>(BitStreamTypeCode.UInt16, new BitStreamCodec.SerializerHandler(BitStreamCodec.smethod_12), new BitStreamCodec.DeserializerHandler(BitStreamCodec.smethod_13));
     BitStreamCodec.RegisterCodec <int>(BitStreamTypeCode.Int32, new BitStreamCodec.SerializerHandler(BitStreamCodec.smethod_14), new BitStreamCodec.DeserializerHandler(BitStreamCodec.smethod_15));
     BitStreamCodec.RegisterCodec <uint>(BitStreamTypeCode.UInt32, new BitStreamCodec.SerializerHandler(BitStreamCodec.smethod_16), new BitStreamCodec.DeserializerHandler(BitStreamCodec.smethod_17));
     BitStreamCodec.RegisterCodec <long>(BitStreamTypeCode.Int64, new BitStreamCodec.SerializerHandler(BitStreamCodec.smethod_18), new BitStreamCodec.DeserializerHandler(BitStreamCodec.smethod_19));
     BitStreamCodec.RegisterCodec <ulong>(BitStreamTypeCode.UInt64, new BitStreamCodec.SerializerHandler(BitStreamCodec.smethod_20), new BitStreamCodec.DeserializerHandler(BitStreamCodec.smethod_21));
     BitStreamCodec.RegisterCodec <float>(BitStreamTypeCode.Single, new BitStreamCodec.SerializerHandler(BitStreamCodec.smethod_22), new BitStreamCodec.DeserializerHandler(BitStreamCodec.smethod_23));
     BitStreamCodec.RegisterCodec <double>(BitStreamTypeCode.Double, new BitStreamCodec.SerializerHandler(BitStreamCodec.smethod_24), new BitStreamCodec.DeserializerHandler(BitStreamCodec.smethod_25));
     BitStreamCodec.RegisterCodec <decimal>(BitStreamTypeCode.Decimal, new BitStreamCodec.SerializerHandler(BitStreamCodec.smethod_26), new BitStreamCodec.DeserializerHandler(BitStreamCodec.smethod_27));
     BitStreamCodec.RegisterCodec <TimeSpan>(BitStreamTypeCode.TimeSpan, new BitStreamCodec.SerializerHandler(BitStreamCodec.smethod_28), new BitStreamCodec.DeserializerHandler(BitStreamCodec.smethod_29));
     BitStreamCodec.RegisterCodec <DateTime>(BitStreamTypeCode.DateTime, new BitStreamCodec.SerializerHandler(BitStreamCodec.smethod_30), new BitStreamCodec.DeserializerHandler(BitStreamCodec.smethod_31));
     BitStreamCodec.RegisterCodec <string>(BitStreamTypeCode.String, new BitStreamCodec.SerializerHandler(BitStreamCodec.smethod_32), new BitStreamCodec.DeserializerHandler(BitStreamCodec.smethod_33));
 }
예제 #3
0
 public void RegisterType<T>(BitStreamCodec.SerializerHandler serializer, BitStreamCodec.DeserializerHandler deserializer)
 {
     BitStreamCodec.RegisterCodec<T>(serializer, deserializer);
 }
 public static void RegisterCodec <T>(byte code, BitStreamCodec.SerializerHandler serializer, BitStreamCodec.DeserializerHandler deserializer)
 {
     BitStreamCodec.RegisterCodec(typeof(T), code, serializer, deserializer);
 }
 public static void RegisterCodec <T>(BitStreamTypeCode typeCode, BitStreamCodec.SerializerHandler serializer, BitStreamCodec.DeserializerHandler deserializer)
 {
     BitStreamCodec.RegisterCodec <T>((byte)typeCode, serializer, deserializer);
 }
 public static BitStreamCodec GetCodec <T>()
 {
     return(BitStreamCodec.GetCodec(typeof(T)));
 }
 private static void smethod_12(BitStream bitStream_0, object object_0, ref long long_0)
 {
     BitStreamCodec.GetCodec <ushort>().method_0(bitStream_0, object_0, ref long_0);
 }
 private static object smethod_31(BitStream bitStream_0, ref long long_0)
 {
     return(BitStreamCodec.GetCodec <DateTime>().method_1(bitStream_0, ref long_0));
 }
 private static void smethod_32(BitStream bitStream_0, object object_0, ref long long_0)
 {
     BitStreamCodec.GetCodec <string>().method_0(bitStream_0, object_0, ref long_0);
 }
 private static object smethod_29(BitStream bitStream_0, ref long long_0)
 {
     return(BitStreamCodec.GetCodec <TimeSpan>().method_1(bitStream_0, ref long_0));
 }
 private static void smethod_30(BitStream bitStream_0, object object_0, ref long long_0)
 {
     BitStreamCodec.GetCodec <DateTime>().method_0(bitStream_0, object_0, ref long_0);
 }
 private static void smethod_28(BitStream bitStream_0, object object_0, ref long long_0)
 {
     BitStreamCodec.GetCodec <TimeSpan>().method_0(bitStream_0, object_0, ref long_0);
 }
 private static object smethod_27(BitStream bitStream_0, ref long long_0)
 {
     return(BitStreamCodec.GetCodec <decimal>().method_1(bitStream_0, ref long_0));
 }
 private static void smethod_26(BitStream bitStream_0, object object_0, ref long long_0)
 {
     BitStreamCodec.GetCodec <decimal>().method_0(bitStream_0, object_0, ref long_0);
 }
예제 #15
0
 public void Write<T>(object value)
 {
     BitStreamCodec codec = BitStreamCodec.GetCodec<T>();
     codec.Serializer(this, value, ref this.long_0);
 }
 private static object smethod_33(BitStream bitStream_0, ref long long_0)
 {
     return(BitStreamCodec.GetCodec <string>().method_1(bitStream_0, ref long_0));
 }
예제 #17
0
 public T Read<T>()
 {
     BitStreamCodec codec = BitStreamCodec.GetCodec<T>();
     return (T)((object)codec.Deserializer(this, ref this.long_1));
 }
 private static object smethod_5(BitStream bitStream_0, ref long long_0)
 {
     return(BitStreamCodec.GetCodec <char>().method_1(bitStream_0, ref long_0));
 }