How can I convert List<byte> to byte[] in C#?

Nano HE picture Nano HE · May 25, 2011 · Viewed 14.8k times · Source

Can I convert via a for loop?

Is there any better method to do it?

 for (int i = 0; i < myListByte.Count ;i++)
 {
     myArryByte[i] = myListByte[i];
 }

Answer

Ry- picture Ry- · May 25, 2011
myArryByte = myListByte.ToArray();