Click or drag to resize
MimeKit

MimeEntityLoad Method (ParserOptions, ContentType, Stream, CancellationToken)

Load a MimeEntity from the specified content stream.

Namespace:  MimeKit
Assembly:  MimeKit (in MimeKit.dll) Version: 2.1.0.0
Syntax
C#
public static MimeEntity Load(
	ParserOptions options,
	ContentType contentType,
	Stream content,
	CancellationToken cancellationToken = null
)

Parameters

options
Type: MimeKitParserOptions
The parser options.
contentType
Type: MimeKitContentType
The Content-Type of the stream.
content
Type: System.IOStream
The content stream.
cancellationToken (Optional)
Type: System.ThreadingCancellationToken
The cancellation token.

Return Value

Type: MimeEntity
The parsed MIME entity.
Exceptions
ExceptionCondition
ArgumentNullException

options is null.

-or-

contentType is null.

-or-

content is null.

OperationCanceledException The operation was canceled via the cancellation token.
FormatException There was an error parsing the entity.
IOException An I/O error occurred.
Remarks
This method is mostly meant for use with APIs such as HttpWebResponse where the headers are parsed separately from the content.
See Also