コード例 #1
0
        // Extract the frame from NetFPGA_Data into a byte array.
        public static void Get_Frame(NetFPGA_Data src, ref byte[] dst)
        {
            // FIXME we don't check the bounds of dst.
            // FIXME we don't null unused locations in dst.
            int offset = 0;

            for (int i = 0; i < src.tdata.Length; i++)
            {
                byte[] bs = BitConverter.GetBytes(src.tdata[i]);
                for (int j = 0; j < bs.Length; j++)
                {
                    if (src.tlast[i] && NetFPGA.to_keep(src, i) > j)
                    {
                        break;
                    }

                    dst[offset] = bs[j];
                    offset++;
                }

                if (src.tlast[i])
                {
                    break;
                }
            }
        }