Empty elements in C# byte array
Byte[] array = new Byte[64];
Array.Clear(array, 0, array.Length);
I tried endlessly to use Array.Clear() to clear a large byte[] that I have in my program. It would NEVER work. I do not know why. But I found a solution:
array = new byte[0];
Use the "clear" method on Array.
Array.Clear(array , 0, array.Length);