ISerializer

Ecng.Serialization

Provides methods for serializing and deserializing objects of type .

实现: ISerializer

方法

DeserializeAsync
public ValueTask<T> DeserializeAsync(Stream stream, CancellationToken cancellationToken)
result = iSerializer.DeserializeAsync(stream, cancellationToken)

Asynchronously deserializes an object of type from the provided stream.

stream
The stream from which the object is deserialized.
cancellationToken
A token to monitor for cancellation requests.

返回值: A ValueTask representing the asynchronous operation and the deserialized object.

SerializeAsync
public ValueTask SerializeAsync(T graph, Stream stream, CancellationToken cancellationToken)
result = iSerializer.SerializeAsync(graph, stream, cancellationToken)

Asynchronously serializes the specified object of type into the provided stream.

graph
The object to serialize.
stream
The stream to which the object is serialized.
cancellationToken
A token to monitor for cancellation requests.

返回值: A ValueTask representing the asynchronous operation.