I am trying to convert a byte array to an int array declaration, and then convert a byte array to an int array.
To convert from a byte array to an int array, I used this code:
int[] iArray = new int[someSize]; byte[] bArray = new byte[iArray.Length * sizeof(int)]; Buffer.BlockCopy(iArray, 0,bArray, 0, bArray.Length);
But when converting from a byte array to an int array, the values ββin the iArray2
array become false when the value in the iArray
array is iArray
than 256 (maybe this is an overflow, I don't know.)
// What is the error in this code?. int iArray2 = new int[someSize]; Buffer.BlockCopy(bArray, 0, iArray2, 0, iArray2.Length);
How can I convert from byte array to int array correctly?
source share