JsonSerializer.SerializeToUtf8Bytes Methode

Definitie

Overloads

Name Description
SerializeToUtf8Bytes(Object, JsonTypeInfo)

Converteert de opgegeven waarde naar een Byte matrix.

SerializeToUtf8Bytes(Object, Type, JsonSerializerOptions)

Converteert een waarde van het opgegeven type naar een JSON-tekenreeks, gecodeerd als UTF-8 bytes.

SerializeToUtf8Bytes(Object, Type, JsonSerializerContext)

Converteert de opgegeven waarde naar een Byte matrix.

SerializeToUtf8Bytes<TValue>(TValue, JsonSerializerOptions)

Converteert de waarde van een type dat is opgegeven door een algemene typeparameter naar een JSON-tekenreeks, gecodeerd als UTF-8 bytes.

SerializeToUtf8Bytes<TValue>(TValue, JsonTypeInfo<TValue>)

Converteert de opgegeven waarde naar een Byte matrix.

SerializeToUtf8Bytes(Object, JsonTypeInfo)

Bron:
JsonSerializer.Write.ByteArray.cs
Bron:
JsonSerializer.Write.ByteArray.cs
Bron:
JsonSerializer.Write.ByteArray.cs
Bron:
JsonSerializer.Write.ByteArray.cs
Bron:
JsonSerializer.Write.ByteArray.cs
Bron:
JsonSerializer.Write.ByteArray.cs

Converteert de opgegeven waarde naar een Byte matrix.

public:
 static cli::array <System::Byte> ^ SerializeToUtf8Bytes(System::Object ^ value, System::Text::Json::Serialization::Metadata::JsonTypeInfo ^ jsonTypeInfo);
public static byte[] SerializeToUtf8Bytes(object? value, System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo);
static member SerializeToUtf8Bytes : obj * System.Text.Json.Serialization.Metadata.JsonTypeInfo -> byte[]
Public Function SerializeToUtf8Bytes (value As Object, jsonTypeInfo As JsonTypeInfo) As Byte()

Parameters

value
Object

De waarde die moet worden geconverteerd.

jsonTypeInfo
JsonTypeInfo

Metagegevens over het type dat moet worden geconverteerd.

Retouren

Byte[]

Een UTF-8-weergave van de waarde.

Uitzonderingen

jsonTypeInfo is null.

value komt niet overeen met het type jsonTypeInfo.

Van toepassing op

SerializeToUtf8Bytes(Object, Type, JsonSerializerOptions)

Bron:
JsonSerializer.Write.ByteArray.cs
Bron:
JsonSerializer.Write.ByteArray.cs
Bron:
JsonSerializer.Write.ByteArray.cs
Bron:
JsonSerializer.Write.ByteArray.cs
Bron:
JsonSerializer.Write.ByteArray.cs
Bron:
JsonSerializer.Write.ByteArray.cs
Bron:
JsonSerializer.Write.ByteArray.cs

Converteert een waarde van het opgegeven type naar een JSON-tekenreeks, gecodeerd als UTF-8 bytes.

[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
public static byte[] SerializeToUtf8Bytes(object? value, Type inputType, System.Text.Json.JsonSerializerOptions? options = default);
public static byte[] SerializeToUtf8Bytes(object? value, Type inputType, System.Text.Json.JsonSerializerOptions? options = default);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
public static byte[] SerializeToUtf8Bytes(object? value, Type inputType, System.Text.Json.JsonSerializerOptions? options = default);
public static byte[] SerializeToUtf8Bytes(object value, Type inputType, System.Text.Json.JsonSerializerOptions options = default);
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")>]
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")>]
static member SerializeToUtf8Bytes : obj * Type * System.Text.Json.JsonSerializerOptions -> byte[]
static member SerializeToUtf8Bytes : obj * Type * System.Text.Json.JsonSerializerOptions -> byte[]
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")>]
static member SerializeToUtf8Bytes : obj * Type * System.Text.Json.JsonSerializerOptions -> byte[]
Public Function SerializeToUtf8Bytes (value As Object, inputType As Type, Optional options As JsonSerializerOptions = Nothing) As Byte()
Public Shared Function SerializeToUtf8Bytes (value As Object, inputType As Type, Optional options As JsonSerializerOptions = Nothing) As Byte()

Parameters

value
Object

De waarde die moet worden geconverteerd.

inputType
Type

Het type dat value u wilt converteren.

options
JsonSerializerOptions

Opties voor het beheren van het conversiegedrag.

Retouren

Byte[]

Een JSON-tekenreeksweergave van de waarde, gecodeerd als UTF-8 bytes.

Kenmerken

Uitzonderingen

inputType is niet compatibel met value.

inputType is null.

Er is geen compatibel JsonConverter voor inputType of de serialiseerbare leden.

Opmerkingen

Zie JSON serialiseren en deserialiseren voor meer informatie.

Van toepassing op

SerializeToUtf8Bytes(Object, Type, JsonSerializerContext)

Bron:
JsonSerializer.Write.ByteArray.cs
Bron:
JsonSerializer.Write.ByteArray.cs
Bron:
JsonSerializer.Write.ByteArray.cs
Bron:
JsonSerializer.Write.ByteArray.cs
Bron:
JsonSerializer.Write.ByteArray.cs
Bron:
JsonSerializer.Write.ByteArray.cs
Bron:
JsonSerializer.Write.ByteArray.cs

Converteert de opgegeven waarde naar een Byte matrix.

public:
 static cli::array <System::Byte> ^ SerializeToUtf8Bytes(System::Object ^ value, Type ^ inputType, System::Text::Json::Serialization::JsonSerializerContext ^ context);
public static byte[] SerializeToUtf8Bytes(object? value, Type inputType, System.Text.Json.Serialization.JsonSerializerContext context);
static member SerializeToUtf8Bytes : obj * Type * System.Text.Json.Serialization.JsonSerializerContext -> byte[]
Public Function SerializeToUtf8Bytes (value As Object, inputType As Type, context As JsonSerializerContext) As Byte()

Parameters

value
Object

De waarde die moet worden geconverteerd.

inputType
Type

Het type dat value u wilt converteren.

context
JsonSerializerContext

Een metagegevensprovider voor serialiseerbare typen.

Retouren

Byte[]

Een UTF-8-weergave van de waarde.

Uitzonderingen

inputType is niet compatibel met value.

inputType is null.

Er is geen compatibel JsonConverter voor inputType of de serialiseerbare leden.

De GetTypeInfo(Type) opgegeven context methode retourneert null het type dat moet worden geconverteerd.

Van toepassing op

SerializeToUtf8Bytes<TValue>(TValue, JsonSerializerOptions)

Bron:
JsonSerializer.Write.ByteArray.cs
Bron:
JsonSerializer.Write.ByteArray.cs
Bron:
JsonSerializer.Write.ByteArray.cs
Bron:
JsonSerializer.Write.ByteArray.cs
Bron:
JsonSerializer.Write.ByteArray.cs
Bron:
JsonSerializer.Write.ByteArray.cs
Bron:
JsonSerializer.Write.ByteArray.cs

Converteert de waarde van een type dat is opgegeven door een algemene typeparameter naar een JSON-tekenreeks, gecodeerd als UTF-8 bytes.

[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
public static byte[] SerializeToUtf8Bytes<TValue>(TValue value, System.Text.Json.JsonSerializerOptions? options = default);
public static byte[] SerializeToUtf8Bytes<TValue>(TValue value, System.Text.Json.JsonSerializerOptions? options = default);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
public static byte[] SerializeToUtf8Bytes<TValue>(TValue value, System.Text.Json.JsonSerializerOptions? options = default);
public static byte[] SerializeToUtf8Bytes<TValue>(TValue value, System.Text.Json.JsonSerializerOptions options = default);
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")>]
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")>]
static member SerializeToUtf8Bytes : 'Value * System.Text.Json.JsonSerializerOptions -> byte[]
static member SerializeToUtf8Bytes : 'Value * System.Text.Json.JsonSerializerOptions -> byte[]
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")>]
static member SerializeToUtf8Bytes : 'Value * System.Text.Json.JsonSerializerOptions -> byte[]
Public Function SerializeToUtf8Bytes(Of TValue) (value As TValue, Optional options As JsonSerializerOptions = Nothing) As Byte()
Public Shared Function SerializeToUtf8Bytes(Of TValue) (value As TValue, Optional options As JsonSerializerOptions = Nothing) As Byte()

Type parameters

TValue

Het type van de waarde.

Parameters

value
TValue

De waarde die moet worden geconverteerd.

options
JsonSerializerOptions

Opties voor het beheren van het conversiegedrag.

Retouren

Byte[]

Een JSON-tekenreeksweergave van de waarde, gecodeerd als UTF-8 bytes.

Kenmerken

Uitzonderingen

Er is geen compatibel JsonConverter voor TValue of de serialiseerbare leden.

Opmerkingen

Zie JSON serialiseren en deserialiseren voor meer informatie.

Van toepassing op

SerializeToUtf8Bytes<TValue>(TValue, JsonTypeInfo<TValue>)

Bron:
JsonSerializer.Write.ByteArray.cs
Bron:
JsonSerializer.Write.ByteArray.cs
Bron:
JsonSerializer.Write.ByteArray.cs
Bron:
JsonSerializer.Write.ByteArray.cs
Bron:
JsonSerializer.Write.ByteArray.cs
Bron:
JsonSerializer.Write.ByteArray.cs
Bron:
JsonSerializer.Write.ByteArray.cs

Converteert de opgegeven waarde naar een Byte matrix.

public:
generic <typename TValue>
 static cli::array <System::Byte> ^ SerializeToUtf8Bytes(TValue value, System::Text::Json::Serialization::Metadata::JsonTypeInfo<TValue> ^ jsonTypeInfo);
public static byte[] SerializeToUtf8Bytes<TValue>(TValue value, System.Text.Json.Serialization.Metadata.JsonTypeInfo<TValue> jsonTypeInfo);
static member SerializeToUtf8Bytes : 'Value * System.Text.Json.Serialization.Metadata.JsonTypeInfo<'Value> -> byte[]
Public Function SerializeToUtf8Bytes(Of TValue) (value As TValue, jsonTypeInfo As JsonTypeInfo(Of TValue)) As Byte()

Type parameters

TValue

Het type van de waarde dat moet worden geserialiseerd.

Parameters

value
TValue

De waarde die moet worden geconverteerd.

jsonTypeInfo
JsonTypeInfo<TValue>

Metagegevens over het type dat moet worden geconverteerd.

Retouren

Byte[]

Een UTF-8-weergave van de waarde.

Uitzonderingen

Er is geen compatibel JsonConverter voor TValue of de serialiseerbare leden.

jsonTypeInfo is null.

Van toepassing op