Class DataSerializer
- Namespace
- Stride.Core.Serialization
- Assembly
- Stride.Core.dll
Describes how to serialize and deserialize an object without knowing its type. Used as a common base class for all data serializers.
public abstract class DataSerializer
- Inheritance
-
DataSerializer
- Derived
Fields
BinaryFormatVersion
public const int BinaryFormatVersion = 4000001
Field Value
SerializationTypeId
The type id of SerializationType. Used internally to avoid dealing with strings.
public ObjectId SerializationTypeId
Field Value
Properties
IsBlittable
public abstract bool IsBlittable { get; }
Property Value
SerializationType
The type of the object that can be serialized or deserialized.
public abstract Type SerializationType { get; }
Property Value
Methods
Initialize(SerializerSelector)
Initializes the specified serializer.
public virtual void Initialize(SerializerSelector serializerSelector)
Parameters
serializerSelector
SerializerSelectorThe serializer.
Remarks
This method should be thread-safe and OK to call multiple times.
PreSerialize(ref object, ArchiveMode, SerializationStream)
Performs the first step of serialization or deserialization.
public abstract 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.
Serialize(ref object, ArchiveMode, SerializationStream)
Serializes or deserializes the given object obj
.
public abstract 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.