VcfDeserializeManyAsync Method

Deserializes a collection of Streams of VCF data in an asynchronous operation and allows to specify an AnsiFilter to select the right Encoding automatically.

Definition

Namespace: FolkerKinzel.VCards
Assembly: FolkerKinzel.VCards (in FolkerKinzel.VCards.dll) Version: 8.0.1+a91cc3f0fd39aeb548e16006a60ca9dd10a304a2
C#
public static IAsyncEnumerable<VCard> DeserializeManyAsync(
	IEnumerable<Func<CancellationToken, Task<Stream>>?> factories,
	AnsiFilter? filter = null,
	CancellationToken token = default
)

Parameters

factories  IEnumerableFuncCancellationToken, TaskStream
A collection of functions that return a either a Stream or null as an asynchronous operation. The collection may return null values.
filter  AnsiFilter  (Optional)
An AnsiFilter instance, or null to parse all Streams with the default Encoding UTF-8.
token  CancellationToken  (Optional)
A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Return Value

IAsyncEnumerableVCard
A collection that provides asynchronous iteration over VCard values.

Remarks

AnsiFilter only recognizes one Encoding per Stream. This means that if a Stream contains VCF data with different Encodings, decoding errors may occur.

Any Streams that are used within the method will be closed when the method completes.

Exceptions

ArgumentNullExceptionfactories is null.
ArgumentExceptionOne of the Streams doesn't support reading.
ObjectDisposedExceptionOne of the functions in factories returns a closed stream.
IOException The method could not read from one of the Streams.

See Also