Cysharp / MemoryPack

Zero encoding extreme performance binary serializer for C# and Unity.
MIT License
3.32k stars 200 forks source link

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

Open YogiCoder8888 opened 2 months ago

YogiCoder8888 commented 2 months ago

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!

neuecc commented 1 month ago

What does incorrectly mean? Please provide the details and data that we can reproduce here without omitting the populate data part.