Utf8JsonWriter 建構函式
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
| 名稱 | Description |
|---|---|
| Utf8JsonWriter(IBufferWriter<Byte>, JsonWriterOptions) |
初始化該類別的新實例 Utf8JsonWriter ,使用指定的 IBufferWriter<T> 設定來寫入輸出及自訂選項。 |
| Utf8JsonWriter(Stream, JsonWriterOptions) |
使用指定的串流初始化該類別的新實例 Utf8JsonWriter ,將輸出寫入並設定選項。 |
Utf8JsonWriter(IBufferWriter<Byte>, JsonWriterOptions)
初始化該類別的新實例 Utf8JsonWriter ,使用指定的 IBufferWriter<T> 設定來寫入輸出及自訂選項。
public Utf8JsonWriter(System.Buffers.IBufferWriter<byte> bufferWriter, System.Text.Json.JsonWriterOptions options = default);
new System.Text.Json.Utf8JsonWriter : System.Buffers.IBufferWriter<byte> * System.Text.Json.JsonWriterOptions -> System.Text.Json.Utf8JsonWriter
Public Sub New (bufferWriter As IBufferWriter(Of Byte), Optional options As JsonWriterOptions = Nothing)
參數
- bufferWriter
- IBufferWriter<Byte>
撰寫 JSON 文字的目的地。
- options
- JsonWriterOptions
定義了 的自訂行為 Utf8JsonWriter。 預設情況下,它會寫入最小化的 JSON(沒有額外空白),並根據 JSON RFC 驗證所寫的 JSON 是否結構有效。
例外狀況
bufferWriter 是 null。
適用於
Utf8JsonWriter(Stream, JsonWriterOptions)
使用指定的串流初始化該類別的新實例 Utf8JsonWriter ,將輸出寫入並設定選項。
public Utf8JsonWriter(System.IO.Stream utf8Json, System.Text.Json.JsonWriterOptions options = default);
new System.Text.Json.Utf8JsonWriter : System.IO.Stream * System.Text.Json.JsonWriterOptions -> System.Text.Json.Utf8JsonWriter
Public Sub New (utf8Json As Stream, Optional options As JsonWriterOptions = Nothing)
參數
- utf8Json
- Stream
撰寫 JSON 文字的目的地。
- options
- JsonWriterOptions
定義了 的自訂行為 Utf8JsonWriter。 預設情況下,它會寫入最小化的 JSON(沒有額外空白),並根據 JSON RFC 驗證所寫的 JSON 是否結構有效。
例外狀況
utf8Json 是 null。