Serializer
Provides an abstract base class for type-specific serializers.
Реализует: ISerializer<T>, ISerializer
Свойства
public abstract string FileExtension { get; }
value = serializer.FileExtension
Gets the file extension associated with this serializer.
Методы
public abstract ValueTask<T> DeserializeAsync(Stream stream, CancellationToken cancellationToken)
result = serializer.DeserializeAsync(stream, cancellationToken)
Deserializes an object graph from the provided stream asynchronously.
- stream
- The stream from which the object graph is deserialized.
- cancellationToken
- A token that can be used to cancel the deserialization operation.
Возвращает: A task that represents the asynchronous deserialize operation. The task result contains the deserialized object graph.
Ecng#Serialization#ISerializer#DeserializeAsync(Stream, CancellationToken)
Non-generic implementation of the deserialize method.
- stream
- The stream from which the object graph is deserialized.
- cancellationToken
- A token that can be used to cancel the deserialization operation.
Возвращает: A task that represents the asynchronous deserialize operation. The task result contains the deserialized object graph.
Ecng#Serialization#ISerializer#SerializeAsync(object, Stream, CancellationToken)
Non-generic implementation of the serialize method.
- graph
- The object graph to serialize.
- stream
- The stream to which the graph is serialized.
- cancellationToken
- A token that can be used to cancel the serialization operation.
Возвращает: A task representing the asynchronous serialize operation.
public abstract ValueTask SerializeAsync(T graph, Stream stream, CancellationToken cancellationToken)
result = serializer.SerializeAsync(graph, stream, cancellationToken)
Serializes the specified object graph to the provided stream asynchronously.
- graph
- The object graph to serialize.
- stream
- The stream to which the graph is serialized.
- cancellationToken
- A token that can be used to cancel the serialization operation.
Возвращает: A task representing the asynchronous serialize operation.