public static object Deserialize(byte[] bytes) { CT_RequestDeckUpdate customObject = new CT_RequestDeckUpdate(); using (var s = new MemoryStream(bytes)) { using (var br = new BinaryReader(s)) { customObject.cards = br.ReadBytes(8); customObject.swapCard = br.ReadBytes(2); } } return(customObject); }
public byte[] swapCard; //0 from 1 to public static byte[] Serialize(object o) { CT_RequestDeckUpdate customType = o as CT_RequestDeckUpdate; using (var s = new MemoryStream()) { using (var bw = new BinaryWriter(s)) { bw.Write(customType.cards); bw.Write(customType.swapCard); return(s.ToArray()); } } }