BinaryData Constructors
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
BinaryData(Byte[]) |
Creates a BinaryData instance by wrapping the provided byte array. |
BinaryData(ReadOnlyMemory<Byte>) |
Creates a BinaryData instance by wrapping the provided bytes. |
BinaryData(String) |
Creates a BinaryData instance from a string by converting the string to bytes using the UTF-8 encoding. |
BinaryData(Byte[], String) | |
BinaryData(ReadOnlyMemory<Byte>, String) | |
BinaryData(String, String) | |
BinaryData(Object, JsonSerializerOptions, Type) |
Creates a BinaryData instance by serializing the provided object to JSON using JsonSerializer. |
BinaryData(Object, JsonSerializerContext, Type) |
Creates a BinaryData instance by serializing the provided object to JSON using JsonSerializer. |
- Source:
- BinaryData.cs
- Source:
- BinaryData.cs
- Source:
- BinaryData.cs
Creates a BinaryData instance by wrapping the provided byte array.
public:
BinaryData(cli::array <System::Byte> ^ data);
public BinaryData(byte[] data);
new BinaryData : byte[] -> BinaryData
Public Sub New (data As Byte())
Parameters
- data
- Byte[]
The byte array to wrap.
Applies to
.NET 10 (package-provided) and other versions
Product | Versions |
---|---|
.NET | 8 (package-provided), 9 (package-provided), 10 (package-provided) |
.NET Standard | 2.0 (package-provided) |
- Source:
- BinaryData.cs
- Source:
- BinaryData.cs
- Source:
- BinaryData.cs
Creates a BinaryData instance by wrapping the provided bytes.
public:
BinaryData(ReadOnlyMemory<System::Byte> data);
public BinaryData(ReadOnlyMemory<byte> data);
new BinaryData : ReadOnlyMemory<byte> -> BinaryData
Public Sub New (data As ReadOnlyMemory(Of Byte))
Parameters
- data
- ReadOnlyMemory<Byte>
The byte data to wrap.
Applies to
.NET 10 (package-provided) and other versions
Product | Versions |
---|---|
.NET | 8 (package-provided), 9 (package-provided), 10 (package-provided) |
.NET Standard | 2.0 (package-provided) |
- Source:
- BinaryData.cs
- Source:
- BinaryData.cs
- Source:
- BinaryData.cs
Creates a BinaryData instance from a string by converting the string to bytes using the UTF-8 encoding.
public:
BinaryData(System::String ^ data);
public BinaryData(string data);
new BinaryData : string -> BinaryData
Public Sub New (data As String)
Parameters
- data
- String
The string data.
Applies to
.NET 10 (package-provided) and other versions
Product | Versions |
---|---|
.NET | 8 (package-provided), 9 (package-provided), 10 (package-provided) |
.NET Standard | 2.0 (package-provided) |
- Source:
- BinaryData.cs
- Source:
- BinaryData.cs
- Source:
- BinaryData.cs
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)
Parameters
- data
- Byte[]
- mediaType
- String
Applies to
.NET 10 (package-provided) and other versions
Product | Versions |
---|---|
.NET | 8 (package-provided), 9 (package-provided), 10 (package-provided) |
.NET Standard | 2.0 (package-provided) |
- Source:
- BinaryData.cs
- Source:
- BinaryData.cs
- Source:
- BinaryData.cs
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)
Parameters
- data
- ReadOnlyMemory<Byte>
- mediaType
- String
Applies to
.NET 10 (package-provided) and other versions
Product | Versions |
---|---|
.NET | 8 (package-provided), 9 (package-provided), 10 (package-provided) |
.NET Standard | 2.0 (package-provided) |
- Source:
- BinaryData.cs
- Source:
- BinaryData.cs
- Source:
- BinaryData.cs
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)
Parameters
- data
- String
- mediaType
- String
Applies to
.NET 10 (package-provided) and other versions
Product | Versions |
---|---|
.NET | 8 (package-provided), 9 (package-provided), 10 (package-provided) |
.NET Standard | 2.0 (package-provided) |
- Source:
- BinaryData.cs
- Source:
- BinaryData.cs
- Source:
- BinaryData.cs
Creates a BinaryData instance by serializing the provided object to JSON using JsonSerializer.
public BinaryData(object? jsonSerializable, System.Text.Json.JsonSerializerOptions? options = default, Type? type = default);
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)
Parameters
- jsonSerializable
- Object
The object to serialize to JSON using JsonSerializer.
- options
- JsonSerializerOptions
The options to use when serializing to JSON.
- type
- Type
The type to use when serializing the data. If not specified, GetType() will be used to determine the type.
Applies to
.NET 10 (package-provided) and other versions
Product | Versions |
---|---|
.NET | 8 (package-provided), 9 (package-provided), 10 (package-provided) |
.NET Standard | 2.0 (package-provided) |
- Source:
- BinaryData.cs
- Source:
- BinaryData.cs
- Source:
- BinaryData.cs
Creates a BinaryData instance by serializing the provided object to JSON using JsonSerializer.
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)
Parameters
- jsonSerializable
- Object
The object that will be serialized to JSON using JsonSerializer.
- context
- JsonSerializerContext
The JsonSerializerContext to use when serializing to JSON.
- type
- Type
The type to use when serializing the data. If not specified, GetType() will be used to determine the type.
Applies to
.NET 10 (package-provided) and other versions
Product | Versions |
---|---|
.NET | 8 (package-provided), 9 (package-provided), 10 (package-provided) |
.NET Standard | 2.0 (package-provided) |
.NET feedback
.NET is an open source project. Select a link to provide feedback: