I have a dictionary object
Dictionary<double, byte[]>
that has keys such as 1.0, 1.1, 1.2, 2.0, 2.1, 2.2, 2.3, 2.4, 3.0, 4.0, ...
I need to concatenate the values (byte[]) such that values with keys 1.0, 1.1, 1.2 is one byte[], values with keys 2.0, 2.1, 2.2, 2.3, 2.4 is one byte[], and so forth.
I am able to get the number of bytearrays I need to end up with but there has to be a more efficient way than how I am trying to do this.
var keys = chunkedStates.Keys;
List<int> Ids = new List<int>();
foreach(var key in keys)
{
var Id = Convert.ToInt32(Math.Truncate(key));
if (!Ids.Contains(Id))
{
Ids.Add(Id);
}
}
So Ids.Count represents the number of bytearrays I should have after the concatenation. But I am stuck as to how to proceed from here...
Any pointers are appreciated.