ISerializer
Ecng.Serialization
Provides methods for serializing and deserializing objects.
Eigenschaften
FileExtension
public string FileExtension { get; }
value = iSerializer.FileExtension
Gets the file extension associated with the serialized format.
Methoden
DeserializeAsync
public ValueTask<object> DeserializeAsync(Stream stream, CancellationToken cancellationToken)
result = iSerializer.DeserializeAsync(stream, cancellationToken)
Asynchronously deserializes an object graph from the provided stream.
- stream
- The stream from which the object is deserialized.
- cancellationToken
- A token to monitor for cancellation requests.
Rückgabe: A ValueTask representing the asynchronous operation and the deserialized object.
SerializeAsync
public ValueTask SerializeAsync(object graph, Stream stream, CancellationToken cancellationToken)
result = iSerializer.SerializeAsync(graph, stream, cancellationToken)
Asynchronously serializes the specified object graph into the provided stream.
- graph
- The object graph to serialize.
- stream
- The stream to which the object is serialized.
- cancellationToken
- A token to monitor for cancellation requests.
Rückgabe: A ValueTask representing the asynchronous operation.