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
Returns
- object
The deserialized object.
Deserialize<T>(byte[])
Deserializes bytes produced by Serialize<T>(T).
T? Deserialize<T>(byte[] data)
Parameters
databyte[]The serialized bytes.
Returns
- T
The deserialized value.
Type Parameters
TThe expected type of the value.
Serialize<T>(T)
Serializes a value to bytes.
byte[] Serialize<T>(T value)
Parameters
valueTThe value to serialize.
Returns
- byte[]
The serialized bytes.
Type Parameters
TThe type of the value.