public override void Decode() { base.Decode(); List <object> list = new List <object>(); this.SeqNumber = ReadLTriad(); byte[] bytes = ReadBytes(); while (bytes.Length != 0) { list.Add(EncapsulatedPacket.ToEncapsulatedPacket(ref bytes)); } this.Packets = list.ToArray(); }
public int GetLength() { int len = 4; foreach (object packet in this.Packets) { if (packet is EncapsulatedPacket) { EncapsulatedPacket pk = (EncapsulatedPacket)packet; len += pk.GetTotalLength(); } else { len += ((byte[])packet).Length; } } return(len); }