MemoryPack icon indicating copy to clipboard operation
MemoryPack copied to clipboard

SortedList<long,float?> and SortedList<long,double?> Deserializes incorrectly

Open YogiCoder8888 opened this issue 6 months ago • 1 comments

I serialized a SortedList<long,float?> with the follow code:

var data = new SortedList<long, float?>();

//.. code to populate data

using (var fs = new FileStream(filepath, FileMode.Create))
{
    await MemoryPackSerializer.SerializeAsync(fs, data);
}

However, when I deserizalised it, the values in the sorted list are incorrect.

using (var readStream = new FileStream(filepath, FileMode.Open))
{
    results = await MemoryPackSerializer.DeserializeAsync<SortedList<long, float?>>(readStream);
}

The same problem seems to happens with SortedList<long,double?>

Am I doing anything incorrectly which may have caused this?

Thanks!

YogiCoder8888 avatar Aug 19 '24 08:08 YogiCoder8888