Table of Contents

Interface IObjectSerialization

Namespace
Arc4u.Serializer
Assembly
Arc4u.Serializer.dll

Defines how objects are converted to and from bytes. The Arc4u caches use an implementation to store their values; the implementation is resolved from the container, optionally by the key given in the SerializerName option of the cache. The Arc4u.Serializer.JSon package provides JSON based implementations.

public interface IObjectSerialization

Methods

Deserialize(byte[], Type)

Deserializes bytes to an object of a type known only at runtime.

object? Deserialize(byte[] data, Type objectType)

Parameters

data byte[]

The serialized bytes.

objectType Type

The type of the object to create.

Returns

object

The deserialized object.

Deserialize<T>(byte[])

Deserializes bytes produced by Serialize<T>(T).

T? Deserialize<T>(byte[] data)

Parameters

data byte[]

The serialized bytes.

Returns

T

The deserialized value.

Type Parameters

T

The expected type of the value.

Serialize<T>(T)

Serializes a value to bytes.

byte[] Serialize<T>(T value)

Parameters

value T

The value to serialize.

Returns

byte[]

The serialized bytes.

Type Parameters

T

The type of the value.