public void ReadFromBitStream(ReadOnlyBitStream bitStream) { header = new PacketHeader(); header.ReadFromBitStream(bitStream); int position = bitStream.GetBitsRead() / 8; data = new Ethernet.Frame(); data.ReadFromBitStream(bitStream); int dataSize = bitStream.GetBitsRead() / 8 - position; int difference = (int)header.GetLength() - dataSize; bitStream.ReadBytes(difference); // Skip padding. }
public Packet() { this.header = null; this.data = null; }