Пример #1
0
 public override void Serialize(BinaryWriter w)
 {
     base.Serialize(w);
     w.Write(requestId);
     ComplexDataSerializer.Serialize(data, w);
     StringSerializer.Serialize(name, w);
     if (datas != null)
     {
         w.Write(true);
         w.Write((int)datas.Count);
         foreach (var element in datas)
         {
             SubDataSerializer.Serialize(element, w);
         }
     }
     else
     {
         w.Write(false);
     }
 }
Пример #2
0
 public override void Deserialize(BinaryReader r)
 {
     base.Deserialize(r);
     requestId = r.ReadInt32();
     data      = ComplexDataSerializer.Deserialize(r);
     name      = StringSerializer.Deserialize(r);
     {
         if (!r.ReadBoolean())
         {
             datas = null;
         }
         else
         {
             int lenght = r.ReadInt32();
             var list   = new List <SubData>(lenght);
             for (int i = 0; i < lenght; i++)
             {
                 var x = SubDataSerializer.Deserialize(r);
                 list.Add(x);
             }
             datas = list;
         }
     }
 }
Пример #3
0
 public override void Deserialize(BinaryReader r)
 {
     base.Deserialize(r);
     RetVal = ComplexDataSerializer.Deserialize(r);
 }
Пример #4
0
 public override void Serialize(BinaryWriter w)
 {
     base.Serialize(w);
     ComplexDataSerializer.Serialize(RetVal, w);
 }