<PackageReference Include="System.Text.Json" Version="10.0.4" />

System.Runtime.InteropServices.JsonMarshal

public static class JsonMarshal
An unsafe class that provides a set of methods to access the underlying data representations of JSON types.
public static ReadOnlySpan<byte> GetRawUtf8PropertyName(JsonProperty property)

Gets a ReadOnlySpan<T> view over the raw JSON data of the given JsonProperty name.

public static ReadOnlySpan<byte> GetRawUtf8Value(JsonElement element)

Gets a ReadOnlySpan<T> view over the raw JSON data of the given JsonElement.