JsonSerializer.SerializeToUtf8Bytes メソッド

定義

オーバーロード

名前 説明
SerializeToUtf8Bytes(Object, JsonTypeInfo)

指定された値を Byte 配列に変換します。

SerializeToUtf8Bytes(Object, Type, JsonSerializerOptions)

指定した型の値を、UTF-8 バイトとしてエンコードされた JSON 文字列に変換します。

SerializeToUtf8Bytes(Object, Type, JsonSerializerContext)

指定された値を Byte 配列に変換します。

SerializeToUtf8Bytes<TValue>(TValue, JsonSerializerOptions)

ジェネリック型パラメーターで指定された型の値を、UTF-8 バイトとしてエンコードされた JSON 文字列に変換します。

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

指定された値を Byte 配列に変換します。

SerializeToUtf8Bytes(Object, JsonTypeInfo)

ソース:
JsonSerializer.Write.ByteArray.cs
ソース:
JsonSerializer.Write.ByteArray.cs
ソース:
JsonSerializer.Write.ByteArray.cs
ソース:
JsonSerializer.Write.ByteArray.cs
ソース:
JsonSerializer.Write.ByteArray.cs
ソース:
JsonSerializer.Write.ByteArray.cs

指定された値を Byte 配列に変換します。

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()

パラメーター

value
Object

変換する値。

jsonTypeInfo
JsonTypeInfo

変換する型に関するメタデータ。

返品

Byte[]

値の UTF-8 表現。

例外

jsonTypeInfonullです。

valuejsonTypeInfoの型と一致しません。

適用対象

SerializeToUtf8Bytes(Object, Type, JsonSerializerOptions)

ソース:
JsonSerializer.Write.ByteArray.cs
ソース:
JsonSerializer.Write.ByteArray.cs
ソース:
JsonSerializer.Write.ByteArray.cs
ソース:
JsonSerializer.Write.ByteArray.cs
ソース:
JsonSerializer.Write.ByteArray.cs
ソース:
JsonSerializer.Write.ByteArray.cs
ソース:
JsonSerializer.Write.ByteArray.cs

指定した型の値を、UTF-8 バイトとしてエンコードされた JSON 文字列に変換します。

[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()

パラメーター

value
Object

変換する値。

inputType
Type

変換する value の型。

options
JsonSerializerOptions

変換動作を制御するオプション。

返品

Byte[]

UTF-8 バイトとしてエンコードされた値の JSON 文字列表現。

属性

例外

inputTypevalue には互換性がありません。

inputTypenullです。

inputTypeまたはそのシリアル化可能なメンバーに互換性のあるJsonConverterはありません。

注釈

詳細については、「 JSON をシリアル化および逆シリアル化する方法」を参照してください。

適用対象

SerializeToUtf8Bytes(Object, Type, JsonSerializerContext)

ソース:
JsonSerializer.Write.ByteArray.cs
ソース:
JsonSerializer.Write.ByteArray.cs
ソース:
JsonSerializer.Write.ByteArray.cs
ソース:
JsonSerializer.Write.ByteArray.cs
ソース:
JsonSerializer.Write.ByteArray.cs
ソース:
JsonSerializer.Write.ByteArray.cs
ソース:
JsonSerializer.Write.ByteArray.cs

指定された値を Byte 配列に変換します。

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()

パラメーター

value
Object

変換する値。

inputType
Type

変換する value の型。

context
JsonSerializerContext

シリアル化可能な型のメタデータ プロバイダー。

返品

Byte[]

値の UTF-8 表現。

例外

inputTypevalue には互換性がありません。

inputTypenullです。

inputTypeまたはそのシリアル化可能なメンバーに互換性のあるJsonConverterはありません。

指定されたcontextGetTypeInfo(Type) メソッドは、変換する型のnullを返します。

適用対象

SerializeToUtf8Bytes<TValue>(TValue, JsonSerializerOptions)

ソース:
JsonSerializer.Write.ByteArray.cs
ソース:
JsonSerializer.Write.ByteArray.cs
ソース:
JsonSerializer.Write.ByteArray.cs
ソース:
JsonSerializer.Write.ByteArray.cs
ソース:
JsonSerializer.Write.ByteArray.cs
ソース:
JsonSerializer.Write.ByteArray.cs
ソース:
JsonSerializer.Write.ByteArray.cs

ジェネリック型パラメーターで指定された型の値を、UTF-8 バイトとしてエンコードされた JSON 文字列に変換します。

[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()

型パラメーター

TValue

値の型。

パラメーター

value
TValue

変換する値。

options
JsonSerializerOptions

変換動作を制御するオプション。

返品

Byte[]

UTF-8 バイトとしてエンコードされた値の JSON 文字列表現。

属性

例外

TValueまたはそのシリアル化可能なメンバーに互換性のあるJsonConverterはありません。

注釈

詳細については、「 JSON をシリアル化および逆シリアル化する方法」を参照してください。

適用対象

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

ソース:
JsonSerializer.Write.ByteArray.cs
ソース:
JsonSerializer.Write.ByteArray.cs
ソース:
JsonSerializer.Write.ByteArray.cs
ソース:
JsonSerializer.Write.ByteArray.cs
ソース:
JsonSerializer.Write.ByteArray.cs
ソース:
JsonSerializer.Write.ByteArray.cs
ソース:
JsonSerializer.Write.ByteArray.cs

指定された値を Byte 配列に変換します。

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()

型パラメーター

TValue

シリアル化する値の型。

パラメーター

value
TValue

変換する値。

jsonTypeInfo
JsonTypeInfo<TValue>

変換する型に関するメタデータ。

返品

Byte[]

値の UTF-8 表現。

例外

TValueまたはそのシリアル化可能なメンバーに互換性のあるJsonConverterはありません。

jsonTypeInfonullです。

適用対象