I am trying to convert byte array to int array then convert the byte array back to int array.
for converting from byte array to 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); // this code works correctly.
but when converting from byte array to int array , the values in the iArray2
array becomes false when the value in the iArray
array is larger than 256 (may be it is overflow i do not 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? thanks?