Skip to content

IPEndPointJsonConverter Methods

Functionality for converting System.Net.IPEndPoint instances to and from their JSON representation.

Read(Utf8JsonReader, Type, JsonSerializerOptions)

override
View source
public override IPEndPoint? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Reads and converts the JSON to type T.

Parameters

readerUtf8JsonReader
The reader.
typeToConvertType
The type to convert.
optionsJsonSerializerOptions
An object that specifies serialization options to use.

Returns

The converted value.

ReadAsPropertyName(Utf8JsonReader, Type, JsonSerializerOptions)

override
View source
public override IPEndPoint ReadAsPropertyName(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Reads a dictionary key from a JSON property name.

Parameters

readerUtf8JsonReader
The System.Text.Json.Utf8JsonReader to read from.
typeToConvertType
The type to convert.
optionsJsonSerializerOptions
The options to use when reading the value.

Returns

The value that was converted.

Write(Utf8JsonWriter, IPEndPoint, JsonSerializerOptions)

override
View source
public override void Write(Utf8JsonWriter writer, IPEndPoint value, JsonSerializerOptions options)
Writes a specified value as JSON.

Parameters

writerUtf8JsonWriter
The writer to write to.
valueIPEndPoint
The value to convert to JSON.
optionsJsonSerializerOptions
An object that specifies serialization options to use.

Exceptions

System.ArgumentNullException
writer or value is null.

WriteAsPropertyName(Utf8JsonWriter, IPEndPoint, JsonSerializerOptions)

override
View source
public override void WriteAsPropertyName(Utf8JsonWriter writer, IPEndPoint value, JsonSerializerOptions options)
Writes a dictionary key as a JSON property name.

Parameters

writerUtf8JsonWriter
The System.Text.Json.Utf8JsonWriter to write to.
valueIPEndPoint
The value to convert. The value of System.Text.Json.Serialization.JsonConverter.HandleNull determines if the converter handles null values.
optionsJsonSerializerOptions
The options to use when writing the value.

Exceptions

System.ArgumentNullException
writer or value is null.