JsonMarshal.GetRawUtf8Value(JsonElement) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
ReadOnlySpan<T>获取给定的原始 JSON 数据的JsonElement视图。
public:
static ReadOnlySpan<System::Byte> GetRawUtf8Value(System::Text::Json::JsonElement element);
public static ReadOnlySpan<byte> GetRawUtf8Value(System.Text.Json.JsonElement element);
static member GetRawUtf8Value : System.Text.Json.JsonElement -> ReadOnlySpan<byte>
Public Shared Function GetRawUtf8Value (element As JsonElement) As ReadOnlySpan(Of Byte)
参数
- element
- JsonElement
要从中提取范围的 JSON 元素。
返回
包含原始 JSON 数据的element跨度。
例外
基础 JsonDocument 已释放。
注解
虽然该方法本身会检查基础 JsonDocument的处置情况,但在方法返回后,它可能会被释放,这将导致跨度指向已返回到共享池的缓冲区。 调用方应格外小心,确保无法避免潜在的数据损坏。