語言

BinaryData 建構函式

定義

多載

名稱 Description
BinaryData(Byte[])

透過包裝提供的位元組陣列來建立 BinaryData 實例。

BinaryData(ReadOnlyMemory<Byte>)

透過包裝提供的位元組來建立實 BinaryData 例。

BinaryData(String)

透過使用 UTF-8 編碼將字串轉換為位元組,從字串建立 BinaryData 實例。

BinaryData(Byte[], String)

透過包裝提供的位元組陣列建立 BinaryData 實例,並設定 MediaType 為 <pref=“mediaType”></see> value。

BinaryData(ReadOnlyMemory<Byte>, String)

BinaryData透過包裝提供的位元組建立實例,並設定MediaType為 <pref=“mediaType”></see> 值。

BinaryData(String, String)

透過使用 UTF-8 編碼將字串轉換為位元組,從字串建立 BinaryData 實例,並設定 MediaType 為 <pref=“mediaType”></see> 值。

BinaryData(Object, JsonSerializerOptions, Type)

透過將JsonSerializer提供的物件序列化成 JSON 來建立BinaryData實例。

BinaryData(Object, JsonSerializerContext, Type)

透過將JsonSerializer提供的物件序列化成 JSON 來建立BinaryData實例。

BinaryData(Byte[])

來源:
BinaryData.cs
來源:
BinaryData.cs
來源:
BinaryData.cs
來源:
BinaryData.cs

透過包裝提供的位元組陣列來建立 BinaryData 實例。

public:
 BinaryData(cli::array <System::Byte> ^ data);
public BinaryData(byte[] data);
new BinaryData : byte[] -> BinaryData
Public Sub New (data As Byte())

參數

data
Byte[]

要包裝的位元組陣列。

適用於

BinaryData(ReadOnlyMemory<Byte>)

來源:
BinaryData.cs
來源:
BinaryData.cs
來源:
BinaryData.cs
來源:
BinaryData.cs

透過包裝提供的位元組來建立實 BinaryData 例。

public:
 BinaryData(ReadOnlyMemory<System::Byte> data);
public BinaryData(ReadOnlyMemory<byte> data);
new BinaryData : ReadOnlyMemory<byte> -> BinaryData
Public Sub New (data As ReadOnlyMemory(Of Byte))

參數

data
ReadOnlyMemory<Byte>

要包裝的位元組資料。

適用於

BinaryData(String)

來源:
BinaryData.cs
來源:
BinaryData.cs
來源:
BinaryData.cs
來源:
BinaryData.cs

透過使用 UTF-8 編碼將字串轉換為位元組,從字串建立 BinaryData 實例。

public:
 BinaryData(System::String ^ data);
public BinaryData(string data);
new BinaryData : string -> BinaryData
Public Sub New (data As String)

參數

data
String

字串資料。

適用於

BinaryData(Byte[], String)

來源:
BinaryData.cs
來源:
BinaryData.cs
來源:
BinaryData.cs
來源:
BinaryData.cs

透過包裝提供的位元組陣列建立 BinaryData 實例,並設定 MediaType 為 <pref=“mediaType”></see> value。

public:
 BinaryData(cli::array <System::Byte> ^ data, System::String ^ mediaType);
public BinaryData(byte[] data, string? mediaType);
new BinaryData : byte[] * string -> BinaryData
Public Sub New (data As Byte(), mediaType As String)

參數

data
Byte[]

陣列要包裹。

mediaType
String

例如,這些資料的 MIME 類型。 Octet

另請參閱

適用於

BinaryData(ReadOnlyMemory<Byte>, String)

來源:
BinaryData.cs
來源:
BinaryData.cs
來源:
BinaryData.cs
來源:
BinaryData.cs

BinaryData透過包裝提供的位元組建立實例,並設定MediaType為 <pref=“mediaType”></see> 值。

public:
 BinaryData(ReadOnlyMemory<System::Byte> data, System::String ^ mediaType);
public BinaryData(ReadOnlyMemory<byte> data, string? mediaType);
new BinaryData : ReadOnlyMemory<byte> * string -> BinaryData
Public Sub New (data As ReadOnlyMemory(Of Byte), mediaType As String)

參數

data
ReadOnlyMemory<Byte>

要封裝的位元組資料。

mediaType
String

例如,這些資料的 MIME 類型。 Octet

另請參閱

適用於

BinaryData(String, String)

來源:
BinaryData.cs
來源:
BinaryData.cs
來源:
BinaryData.cs
來源:
BinaryData.cs

透過使用 UTF-8 編碼將字串轉換為位元組,從字串建立 BinaryData 實例,並設定 MediaType 為 <pref=“mediaType”></see> 值。

public:
 BinaryData(System::String ^ data, System::String ^ mediaType);
public BinaryData(string data, string? mediaType);
new BinaryData : string * string -> BinaryData
Public Sub New (data As String, mediaType As String)

參數

data
String

字串資料。

mediaType
String

例如,這些資料的 MIME 類型。 Octet

另請參閱

適用於

BinaryData(Object, JsonSerializerOptions, Type)

來源:
BinaryData.cs
來源:
BinaryData.cs
來源:
BinaryData.cs
來源:
BinaryData.cs

透過將JsonSerializer提供的物件序列化成 JSON 來建立BinaryData實例。

[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation.")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed.")]
public BinaryData(object? jsonSerializable, System.Text.Json.JsonSerializerOptions? options = default, Type? type = default);
public BinaryData(object? jsonSerializable, System.Text.Json.JsonSerializerOptions? options = default, Type? type = default);
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation.")>]
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed.")>]
new BinaryData : obj * System.Text.Json.JsonSerializerOptions * Type -> BinaryData
new BinaryData : obj * System.Text.Json.JsonSerializerOptions * Type -> BinaryData
Public Sub New (jsonSerializable As Object, Optional options As JsonSerializerOptions = Nothing, Optional type As Type = Nothing)

參數

jsonSerializable
Object

用來序列化成 JSON JsonSerializer的物件。

options
JsonSerializerOptions

序列化成 JSON 時可以使用的選項。

type
Type

序列化資料時使用的類型。 若未指定, GetType() 將用來判定類型。

屬性

另請參閱

適用於

BinaryData(Object, JsonSerializerContext, Type)

來源:
BinaryData.cs
來源:
BinaryData.cs
來源:
BinaryData.cs
來源:
BinaryData.cs

透過將JsonSerializer提供的物件序列化成 JSON 來建立BinaryData實例。

public BinaryData(object? jsonSerializable, System.Text.Json.Serialization.JsonSerializerContext context, Type? type = default);
new BinaryData : obj * System.Text.Json.Serialization.JsonSerializerContext * Type -> BinaryData
Public Sub New (jsonSerializable As Object, context As JsonSerializerContext, Optional type As Type = Nothing)

參數

jsonSerializable
Object

將用 S 序列化成 JSON JsonSerializer的物件。

context
JsonSerializerContext

序列化成 JSON 時要用的。JsonSerializerContext

type
Type

序列化資料時使用的類型。 若未指定, GetType() 將用來判定類型。

另請參閱

適用於