Skip to main content

JsonBinarySerializer Class

Abblix.Oidc.Server

Abblix.Oidc.Server.Common.Implementation

JsonBinarySerializer Class

Provides functionality to serialize and deserialize objects to and from JSON binary representations. Implements the IBinarySerializer interface using the System.Text.Json library for serialization.

public class JsonBinarySerializer : Abblix.Oidc.Server.Common.Interfaces.IBinarySerializer

Inheritance System.Object → JsonBinarySerializer

Implements IBinarySerializer

Constructors

JsonBinarySerializer(Encoding, JsonSerializerOptions) Constructor

Provides functionality to serialize and deserialize objects to and from JSON binary representations. Implements the IBinarySerializer interface using the System.Text.Json library for serialization.

public JsonBinarySerializer(System.Text.Encoding? encoding=null, System.Text.Json.JsonSerializerOptions? options=null);

Parameters

encoding System.Text.Encoding
options System.Text.Json.JsonSerializerOptions

Methods

JsonBinarySerializer.Deserialize<T>(byte[]) Method

Deserializes a binary representation of a JSON object to its original type.

public T? Deserialize<T>(byte[] bytes);

Type parameters

T

The type of the object to deserialize into.

Parameters

bytes System.Byte[]

The binary representation of the JSON object to deserialize.

Implements Deserialize<T>(byte[])

Returns

T
The deserialized object of type T.

JsonBinarySerializer.Serialize<T>(T) Method

Serializes an object to a binary representation in JSON format.

public byte[] Serialize<T>(T obj);

Type parameters

T

The type of the object to serialize.

Parameters

obj T

The object to serialize into JSON format.

Implements Serialize<T>(T)

Returns

System.Byte[]
A byte array representing the serialized object in JSON format.