public static ComplexData Deserialize(BinaryReader r) { { bool isNotNull = r.ReadBoolean(); if (!isNotNull) { return(null); } } var ret = new ComplexData(); ret.SomeByte = r.ReadByte(); ret.SomeShort = r.ReadInt16(); ret.SomeUShort = r.ReadUInt16(); ret.SomeInt = r.ReadInt32(); ret.SomeUInt = r.ReadUInt32(); ret.SomeLong = r.ReadInt64(); ret.SomeULong = r.ReadUInt64(); ret.SomeString = StringSerializer.Deserialize(r); { if (!r.ReadBoolean()) { ret.SomeArrString = null; } else { int lenght = r.ReadInt32(); var list = new List <String>(lenght); for (int i = 0; i < lenght; i++) { var x = StringSerializer.Deserialize(r); list.Add(x); } ret.SomeArrString = list; } } { if (!r.ReadBoolean()) { ret.SomeArrRec = 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); } ret.SomeArrRec = list; } } return(ret); }
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; } } }