VcfDeserializeAsync(FuncCancellationToken, TaskStream, Encoding, CancellationToken) Method

Deserializes a Stream of VCF data in an asynchronous operation.

Definition

Namespace: FolkerKinzel.VCards
Assembly: FolkerKinzel.VCards (in FolkerKinzel.VCards.dll) Version: 8.0.1+a91cc3f0fd39aeb548e16006a60ca9dd10a304a2
C#
public static Task<IReadOnlyList<VCard>> DeserializeAsync(
	Func<CancellationToken, Task<Stream>> factory,
	Encoding? textEncoding = null,
	CancellationToken token = default
)

Parameters

factory  FuncCancellationToken, TaskStream
A function that takes a CancellationToken as argument and returns a Stream of VCF data as an asynchronous operation.
textEncoding  Encoding  (Optional)
The text encoding to use for deserialization or null, to deserialize the Stream with the standard-compliant text encoding UTF8.
token  CancellationToken  (Optional)
A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Return Value

TaskIReadOnlyListVCard
The task object representing the asynchronous operation.

Remarks

The Streams that is used within the method will be closed when the method completes.

Exceptions

ArgumentNullExceptionfactory is null.
ArgumentExceptionThe Stream that factory returns asynchronously doesn't support reading.
ObjectDisposedExceptionfactory returns a closed stream.
IOException The method could not read from the Stream.

See Also