I have a byte array of
byte[] d = new byte[64];
now i want to convert it to a 2d byte array like ..
byte[,] data = new byte[8,8];
can any one help me on this
This could be one of method.
byte[] d = new byte[64];
byte[,] data = new byte[8,8];
int row = 0;
int column = 0;
for(i=0; i < d.Length; i++)
{
row = i%8;
column = i/8;
data [row, column] = d[i];
}
d.Length and data[column,row] thats itYou can use the Buffer.BlockCopy Method:
byte[] d = new byte[64];
byte[,] data = new byte[8,8];
Buffer.BlockCopy(d, 0, data, 0, 64);