I have an object with a Property of type byte[,,*]
now i’d like to use System.Random::NextBytes() to fill this multidimensional array with random values.
NextBytes however takes an argument of byte[]
can i cast the multidimensional array somehow to the singledimensional one in order to pass it as an argument?
thanks!
You can’t cast it, but you can copy the values quickly from a normal
byte[]to abyte[,,]usingBuffer.BlockCopy. So you’ll have to allocate a normal byte array to start with, then copy the results over.Sample: