neuecc / Utf8Json

Definitely Fastest and Zero Allocation JSON Serializer for C#(NET, .NET Core, Unity, Xamarin).
MIT License
2.36k stars 267 forks source link

support for deserializing from List of ArraySegment #202

Open emceelovin opened 4 years ago

emceelovin commented 4 years ago

this is my WebSocket receive code, and i was wondering if i or someone could add in support to avoid the call to List.ToArray to skip another allocation? possibly having a JsonSerializer.Deserialize(IEnumerable) if even possible?

`if (result.EndOfMessage) { var m = Utf8Json.JsonSerializer.Deserialize(msg.ToArray()); // var m = Utf8Json.JsonSerializer.Deserialize(msg);

          msg.Clear();

          await ProcessAuthMessages(m, ws);

}`