日期:2014-05-18 浏览次数:20999 次
     byte[] a ;
            byte[] b ;
            byte[] c = new byte[] { Convert.ToByte(a.Length + b.Length) };
            byte[] d = new byte[c.Length + a.Length + b.Length];
            int pos = 0;
            Buffer.BlockCopy(c, 0, d, 0, c.Length);
            pos += c.Length;
            Buffer.BlockCopy(a, 0, d, pos, a.Length);
            pos += a.Length;
            Buffer.BlockCopy(b, 0, d, pos, b.Length);
 byte[] a={1,2,3};
                byte[] b={5,6,7,8};
                byte[] c = new byte[] { Convert.ToByte(a.Length + b.Length) };
                byte[] d = a.Concat(b).Concat(c).ToArray();
------解决方案--------------------
            byte[] a = { 1, 2, 3 };
           byte[] b = { 5, 6, 7, 8 };
           List<byte> c = new List<byte>(a);
           c.AddRange(b);
           return c.ToArray();
------解决方案--------------------
你觉得你的很差,其实一点也不差,在怎折腾也是拷贝过去