I'm trying to get a byte[] array 'a' into a List 'b', but it's not working. Say I have this byte array 'a'.
12344
23425
34426
34533
I would like to get it into a 4 item (# of rows) List , but this isn't working. (setting up intermediate byte[] then adding it)
byte[] a = {1,2,3,4,4,2,3,4,2,5,3,4,4,2,6,3,4,5,3,3};
List<byte[]> b = new List<byte[]>();
byte[] inter_byte= new byte[5];
for (int u=0; u<4; u++)
{
for (int p=0; p<5; p++)
{
inter_byte[u] = file[(5*u) + p];
}
b.Add(inter_byte);
}
What I'm getting is a List 4 rows long, but it is all the last row. What's the best way to do this?