public override void Deserialize(byte[] bytes, ref int index) { var countBytes = new byte[4]; this.Headers.Clear(); Array.Copy(bytes, index, countBytes, 0, countBytes.Length); index += 4; if (BitConverter.IsLittleEndian) { Array.Reverse(countBytes); } int count = BitConverter.ToInt32(countBytes, 0); var headerIndex = 0; while (headerIndex < count) { var headerMsg = new BlockHeaderMsg(); headerMsg.Deserialize(bytes, ref index); this.Headers.Add(headerMsg); headerIndex++; } }
public override void Deserialize(byte[] bytes, ref int index) { this.Header = new BlockHeaderMsg(); this.Header.Deserialize(bytes, ref index); }