public BitStreamCodec(Type type, byte bytecode, BitStreamCodec.SerializerHandler serializer, BitStreamCodec.DeserializerHandler deserializer)
 {
     this.Type         = type;
     this.Code         = bytecode;
     this.Serializer   = serializer;
     this.Deserializer = deserializer;
 }
 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;
     }
 }
 public static void RegisterCodec(Type type, byte code, BitStreamCodec.SerializerHandler serializer, BitStreamCodec.DeserializerHandler deserializer)
 {
     if (BitStreamCodec.dictionary_0.ContainsKey(type))
     {
         return;
     }
     BitStreamCodec.dictionary_0[type] = new BitStreamCodec(type, code, serializer, deserializer);
 }
Ejemplo n.º 4
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);
 }