Class DataSerializer<T>
- Namespace
- Stride.Core.Serialization
- Assembly
- Stride.Core.dll
Describes how to serialize and deserialize an object of a given type.
public abstract class DataSerializer<T> : DataSerializer
Type Parameters
T
The type of object to serialize or deserialize.
- Inheritance
-
DataSerializer<T>
- Derived
- Inherited Members
Properties
IsBlittable
public override bool IsBlittable { get; }
Property Value
SerializationType
The type of the object that can be serialized or deserialized.
public override Type SerializationType { get; }
Property Value
Methods
PreSerialize(ref object, ArchiveMode, SerializationStream)
Performs the first step of serialization or deserialization.
public override void PreSerialize(ref object obj, ArchiveMode mode, SerializationStream stream)
Parameters
obj
objectThe object to process.
mode
ArchiveModeThe serialization mode.
stream
SerializationStreamThe stream to serialize or deserialize to.
Remarks
Typically, it will instantiate the object if [null], and if it's a collection clear it.
PreSerialize(ref T, ArchiveMode, SerializationStream)
Performs the first step of serialization or deserialization.
public virtual void PreSerialize(ref T obj, ArchiveMode mode, SerializationStream stream)
Parameters
obj
TThe object to process.
mode
ArchiveModeThe serialization mode.
stream
SerializationStreamThe stream to serialize or deserialize to.
Remarks
Typically, it will instantiate the object if [null], and if it's a collection clear it.
Serialize(ref object, ArchiveMode, SerializationStream)
Serializes or deserializes the given object obj
.
public override void Serialize(ref object obj, ArchiveMode mode, SerializationStream stream)
Parameters
obj
objectThe object to serialize or deserialize.
mode
ArchiveModeThe serialization mode.
stream
SerializationStreamThe stream to serialize or deserialize to.
Serialize(T, SerializationStream)
Serializes the given object obj
.
public void Serialize(T obj, SerializationStream stream)
Parameters
obj
TThe object to serialize or deserialize.
stream
SerializationStreamThe stream to serialize or deserialize to.
Serialize(ref T, ArchiveMode, SerializationStream)
Serializes or deserializes the given object obj
.
public abstract void Serialize(ref T obj, ArchiveMode mode, SerializationStream stream)
Parameters
obj
TThe object to serialize or deserialize.
mode
ArchiveModeThe serialization mode.
stream
SerializationStreamThe stream to serialize or deserialize to.