MimeEntityLoadAsync(Stream, CancellationToken) Method

Asynchronously load a MimeEntity from the specified stream.

Definition

Namespace: MimeKit
Assembly: MimeKit.Core (in MimeKit.Core.dll) Version: 5.0.0
C#
public static Task<MimeEntity> LoadAsync(
	Stream stream,
	CancellationToken cancellationToken = default
)

Parameters

stream  Stream
The stream.
cancellationToken  CancellationToken  (Optional)
The cancellation token.

Return Value

TaskMimeEntity
The parsed MIME entity.

Remarks

Loads a MimeEntity from the given stream, using the default ParserOptions.

Exceptions

ArgumentNullException stream is .
OperationCanceledException The operation was canceled via the cancellation token.
FormatException There was an error parsing the entity.
IOException An I/O error occurred.

See Also