S Shiva Oct 9, 2004 #2 Hi, Look at Array.Copy() and Array.CopyTo() methods. What is the best way to combine two byte[]? I am not finding one yet. Thanks
Hi, Look at Array.Copy() and Array.CopyTo() methods. What is the best way to combine two byte[]? I am not finding one yet. Thanks
M Mattias Sjögren Oct 9, 2004 #3 What is the best way to combine two byte[]? I am not finding one yet. Click to expand... Something like this: byte[] Combine(byte[] a, byte[] b) { byte[] c = new byte[a.Length + b.Length]; System.Buffer.BlockCopy(a, 0, c, 0, a.Length); System.Buffer.BlockCopy(b, 0, c, a.Length, b.Length); return c; } Mattias
What is the best way to combine two byte[]? I am not finding one yet. Click to expand... Something like this: byte[] Combine(byte[] a, byte[] b) { byte[] c = new byte[a.Length + b.Length]; System.Buffer.BlockCopy(a, 0, c, 0, a.Length); System.Buffer.BlockCopy(b, 0, c, a.Length, b.Length); return c; } Mattias