Пример #1
0
        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.
        }
Пример #2
0
 public Packet()
 {
     this.header = null;
     this.data   = null;
 }