2 ms·
.NET has this built in with Utf8JsonReader [1]. > Utf8JsonReader is a high-performance, low allocation, forward-only reader for UTF-8 encoded JSON text, read f
by taspeotis 4y ago
.NET has this built in with Utf8JsonReader [1].
> Utf8JsonReader is a high-performance, low allocation, forward-only reader for UTF-8 encoded JSON text, read from a ReadOnlySpan<byte> or ReadOnlySequence<byte>
Although it's a bit cumbersome to use with a stream [2].
[1] https://learn.microsoft.com/en-us/dotnet/standard/serialization/system-text-json/use-dom-utf8jsonreader-utf8jsonwriter?pivots=dotnet-7-0#use-utf8jsonreader https://learn.microsoft.com/en-us/dotnet/standard/serializat...
[2] https://learn.microsoft.com/en-us/dotnet/standard/serialization/system-text-json/use-dom-utf8jsonreader-utf8jsonwriter?pivots=dotnet-7-0#read-from-a-stream-using-utf8jsonreader https://learn.microsoft.com/en-us/dotnet/standard/serializat...