JsonReaderState(JsonReaderOptions) 构造函数

定义

构造一个新 JsonReaderState 实例。

public JsonReaderState(System.Text.Json.JsonReaderOptions options = default);
new System.Text.Json.JsonReaderState : System.Text.Json.JsonReaderOptions -> System.Text.Json.JsonReaderState
Public Sub New (Optional options As JsonReaderOptions = Nothing)

参数

options
JsonReaderOptions

定义与 JSON RFC 不同的自定义行为 Utf8JsonReader (例如如何处理注释或读取时允许的最大深度)。 默认情况下, Utf8JsonReader 遵循 JSON RFC 严格(JSON 中的注释无效),最大深度为 64。

例外

最大深度设置为非正值 (< 0)。

注解

必须将此状态的实例传递给 Utf8JsonReader 包含 JSON 数据的构造函数。 Utf8JsonReader与引用结构不同的是,状态可以在异步/等待边界之间生存,因此需要此类型才能异步读取更多数据,然后再继续使用新实例Utf8JsonReader

适用于