Utf8JsonWriter.WriteBase64String 方法

定義

多載

WriteBase64String(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>)

寫入屬性名稱和原始位元組值 (以 Base64 編碼 JSON 字串),作為 JSON 物件名稱/值組的一部分。

WriteBase64String(ReadOnlySpan<Char>, ReadOnlySpan<Byte>)

寫入屬性名稱和原始位元組值 (以 Base64 編碼 JSON 字串),作為 JSON 物件名稱/值組的一部分。

WriteBase64String(String, ReadOnlySpan<Byte>)

寫入屬性名稱和原始位元組值 (以 Base64 編碼 JSON 字串),作為 JSON 物件名稱/值組的一部分。

WriteBase64String(JsonEncodedText, ReadOnlySpan<Byte>)

寫入預先編碼的屬性名稱和原始位元組值 (以 Base 64 編碼的 JSON 字串形式),成為 JSON 物件名稱/值組的一部分。

WriteBase64String(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>)

來源:
Utf8JsonWriter.WriteProperties.Bytes.cs
來源:
Utf8JsonWriter.WriteProperties.Bytes.cs
來源:
Utf8JsonWriter.WriteProperties.Bytes.cs

寫入屬性名稱和原始位元組值 (以 Base64 編碼 JSON 字串),作為 JSON 物件名稱/值組的一部分。

public:
 void WriteBase64String(ReadOnlySpan<System::Byte> utf8PropertyName, ReadOnlySpan<System::Byte> bytes);
public void WriteBase64String (ReadOnlySpan<byte> utf8PropertyName, ReadOnlySpan<byte> bytes);
member this.WriteBase64String : ReadOnlySpan<byte> * ReadOnlySpan<byte> -> unit
Public Sub WriteBase64String (utf8PropertyName As ReadOnlySpan(Of Byte), bytes As ReadOnlySpan(Of Byte))

參數

utf8PropertyName
ReadOnlySpan<Byte>

要寫入的屬性 UTF-8 編碼名稱。

bytes
ReadOnlySpan<Byte>

要以 Base64 編碼文字形式寫入的二進位資料。

例外狀況

指定的屬性名稱或值太大。

已啟用驗證,且此方法會導致寫入無效的 JSON。

備註

要寫入為 Base64 的二進位資料大小上限為 125,000,000 個位元組 (或大約 125 MB) 。 超過此限制會導致 ArgumentException 擲回 。

屬性名稱會逸出,而且位元組會在寫入之前進行編碼。

適用於

WriteBase64String(ReadOnlySpan<Char>, ReadOnlySpan<Byte>)

來源:
Utf8JsonWriter.WriteProperties.Bytes.cs
來源:
Utf8JsonWriter.WriteProperties.Bytes.cs
來源:
Utf8JsonWriter.WriteProperties.Bytes.cs

寫入屬性名稱和原始位元組值 (以 Base64 編碼 JSON 字串),作為 JSON 物件名稱/值組的一部分。

public:
 void WriteBase64String(ReadOnlySpan<char> propertyName, ReadOnlySpan<System::Byte> bytes);
public void WriteBase64String (ReadOnlySpan<char> propertyName, ReadOnlySpan<byte> bytes);
member this.WriteBase64String : ReadOnlySpan<char> * ReadOnlySpan<byte> -> unit
Public Sub WriteBase64String (propertyName As ReadOnlySpan(Of Char), bytes As ReadOnlySpan(Of Byte))

參數

propertyName
ReadOnlySpan<Char>

要轉碼並寫入為 UTF-8 的 JSON 物件屬性名稱。

bytes
ReadOnlySpan<Byte>

要以 Base64 編碼文字形式寫入的二進位資料。

例外狀況

指定的屬性名稱或值太大。

已啟用驗證,且此方法會導致寫入無效的 JSON。

備註

要寫入為 Base64 的二進位資料大小上限為 125,000,000 個位元組 (或大約 125 MB) 。 超過此限制會導致 ArgumentException 擲回 。

屬性名稱會逸出,而且位元組會在寫入之前進行編碼。

適用於

WriteBase64String(String, ReadOnlySpan<Byte>)

來源:
Utf8JsonWriter.WriteProperties.Bytes.cs
來源:
Utf8JsonWriter.WriteProperties.Bytes.cs
來源:
Utf8JsonWriter.WriteProperties.Bytes.cs

寫入屬性名稱和原始位元組值 (以 Base64 編碼 JSON 字串),作為 JSON 物件名稱/值組的一部分。

public:
 void WriteBase64String(System::String ^ propertyName, ReadOnlySpan<System::Byte> bytes);
public void WriteBase64String (string propertyName, ReadOnlySpan<byte> bytes);
member this.WriteBase64String : string * ReadOnlySpan<byte> -> unit
Public Sub WriteBase64String (propertyName As String, bytes As ReadOnlySpan(Of Byte))

參數

propertyName
String

要轉碼並寫入為 UTF-8 的 JSON 物件屬性名稱。

bytes
ReadOnlySpan<Byte>

要以 Base64 編碼文字形式寫入的二進位資料。

例外狀況

指定的屬性名稱或值太大。

已啟用驗證,且此方法會導致寫入無效的 JSON。

propertyName 參數為 null

備註

要寫入為 Base64 的二進位資料大小上限為 125,000,000 個位元組 (或大約 125 MB) 。 超過此限制會導致 ArgumentException 擲回 。

屬性名稱會逸出,而且位元組會在寫入之前進行編碼。

適用於

WriteBase64String(JsonEncodedText, ReadOnlySpan<Byte>)

來源:
Utf8JsonWriter.WriteProperties.Bytes.cs
來源:
Utf8JsonWriter.WriteProperties.Bytes.cs
來源:
Utf8JsonWriter.WriteProperties.Bytes.cs

寫入預先編碼的屬性名稱和原始位元組值 (以 Base 64 編碼的 JSON 字串形式),成為 JSON 物件名稱/值組的一部分。

public:
 void WriteBase64String(System::Text::Json::JsonEncodedText propertyName, ReadOnlySpan<System::Byte> bytes);
public void WriteBase64String (System.Text.Json.JsonEncodedText propertyName, ReadOnlySpan<byte> bytes);
member this.WriteBase64String : System.Text.Json.JsonEncodedText * ReadOnlySpan<byte> -> unit
Public Sub WriteBase64String (propertyName As JsonEncodedText, bytes As ReadOnlySpan(Of Byte))

參數

propertyName
JsonEncodedText

要寫入的屬性 JSON 編碼名稱。

bytes
ReadOnlySpan<Byte>

要以 Base64 編碼文字形式寫入的二進位資料。

例外狀況

指定的值太大。

已啟用驗證,且此方法會導致寫入無效的 JSON。

備註

要寫入為 Base64 的二進位資料大小上限為 125,000,000 個位元組 (或大約 125 MB) 。 超過此限制會導致 ArgumentException 擲回 。

建立 的 JsonEncodedText 實例時,應該已經逸出屬性名稱。

在寫入之前,會先編碼位元組。

適用於