public OfpFlowMod(Stream stream, OfpHeader header = null)
        {
            BeBinaryReader br = new BeBinaryReader(stream, Encoding.ASCII, true);

            Header = header ?? new OfpHeader(stream);
            //var pos = stream.Position;
            Match = new OfpMatch(stream);
            //pos = stream.Position;
            br.Parse(out Cookie);
            br.Parse(out Command);
            br.Parse(out IdleTimeout);
            br.Parse(out HardTimeout);
            br.Parse(out Priority);
            br.Parse(out BufferId);
            br.Parse(out OutPort); //FIXED:
            br.Parse(out Flags);
            //pos = stream.Position;
            IOfpAction action = OfpActionHeader.ParseAction(stream);

            while (action != null)
            {
                Actions[action.Header.Type] = action;
                action = OfpActionHeader.ParseAction(stream);
            }
        }
        public OfpFlowStats(Stream stream)
        {
            BeBinaryReader br = new BeBinaryReader(stream, Encoding.ASCII, true);

            br.Parse(out Length);
            br.Parse(out TableId);
            br.ReadBytes(1);
            Match = new OfpMatch(stream);
            br.Parse(out DurationSec);
            br.Parse(out DurationNsec);
            br.Parse(out Priority);
            br.Parse(out IdleTimeout);
            br.Parse(out HardTimeout);
            br.ReadBytes(6);
            br.Parse(out Cookie);
            br.Parse(out PacketCount);
            br.Parse(out ByteCount);

            IOfpAction action = OfpActionHeader.ParseAction(stream);

            while (action != null)
            {
                Actions[action.Header.Type] = action;
                action = OfpActionHeader.ParseAction(stream);
            }
        }
        public OfpPacketOut(Stream stream, OfpHeader header = null)
        {
            BeBinaryReader br = new BeBinaryReader(stream, Encoding.ASCII, true);

            Header = header ?? new OfpHeader(stream);
            br.Parse(out BufferId);
            br.Parse(out InPort);
            br.Parse(out ActionsLen);

            int length = ActionsLen;

            while (length >= 8)
            {
                var action = OfpActionHeader.ParseAction(stream);
                Actions[action.Header.Type] = action;
                length -= action.Header.Len;
            }

            if (BufferId == uint.MaxValue) //-1
            {
                length = Header.Length - (int)Size - ActionsLen;
                if (length > 0)
                {
                    br.Parse(out Data, length);
                }
            }
        }