Class PODSlimSerializer
Serializes CLR object graphs using PortableObjectDocument container and Slim binary serialization algorithm. This class is far less performant than SlimSerializer, however it serializes types using document model that allows to transform/change data during serialization/deserialization. This class is needed for upgrades, when object metadata may change but need to be read (maybe partially) back into the new type structure
Inheritance
Inherited Members
Namespace: Azos.Serialization.Slim
Assembly: Azos.dll
Syntax
public class PODSlimSerializer : ISlimSerializer, ISerializer
Constructors
PODSlimSerializer()
Declaration
public PODSlimSerializer()
Methods
Deserialize(Stream)
Desirializes a graph of arbitrary CLR objects that was serialized before
Declaration
public object Deserialize(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | Source data stream in Slim binary format |
Returns
Type | Description |
---|---|
System.Object | CLR object graph which is deserialized from possibly transformed PortableObjectDocument container |
Deserialize(Stream, ReadingStrategy)
Desirializes a graph of arbitrary CLR objects that was serialized before
Declaration
public object Deserialize(Stream stream, ReadingStrategy readingStrategy = null)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | Source data stream in Slim binary format |
ReadingStrategy | readingStrategy | Optional reading strategy |
Returns
Type | Description |
---|---|
System.Object | CLR object graph which is deserialized from possibly transformed PortableObjectDocument container |
DeserializeDocument(Stream)
Deserializes a PortableObjectDocument container instance
Declaration
public PortableObjectDocument DeserializeDocument(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | Source data stream in Slim binary format |
Returns
Type | Description |
---|---|
PortableObjectDocument | PortableObjectDocument instance |
Serialize(Stream, Object)
Serializes a graph of arbitrary CLR objects into stream using PortableObjectDocument container
Declaration
public void Serialize(Stream stream, object root)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | Target stream |
System.Object | root | CLR object graph |
Serialize(Stream, Object, Nullable<DateTime>, String)
Serializes a graph of arbitrary CLR objects into stream using PortableObjectDocument container, optionally taking document creation attributes
Declaration
public void Serialize(Stream stream, object root, DateTime? documentCreationDate = default(DateTime? ), string documentNotes = null)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | Target stream |
System.Object | root | CLR object graph |
System.Nullable<System.DateTime> | documentCreationDate | Optional document creation attribute |
System.String | documentNotes | Optional document creation attribute |
Explicit Interface Implementations
ISerializer.IsThreadSafe
This serializer is thread-safe
Declaration
bool ISerializer.IsThreadSafe { get; }
Returns
Type | Description |
---|---|
System.Boolean |
ISlimSerializer.BatchTypesAdded
Not supported here
Declaration
bool ISlimSerializer.BatchTypesAdded { get; }
Returns
Type | Description |
---|---|
System.Boolean |
ISlimSerializer.ResetCallBatch()
This method does nothig in this class
Declaration
void ISlimSerializer.ResetCallBatch()
ISlimSerializer.TypeMode
This serializer always uses "PerCall" setting. Setting this property has no effect
Declaration
TypeRegistryMode ISlimSerializer.TypeMode { get; set; }
Returns
Type | Description |
---|---|
TypeRegistryMode |