Click or drag to resize
MimeKit

ContentTypeTryParse(ParserOptions, Byte, Int32, Int32, ContentType) Method

Try to parse the given input buffer into a new ContentType instance.

Namespace: MimeKit
Assembly: MimeKit (in MimeKit.dll) Version: 4.7.1
Syntax
C#
public static bool TryParse(
	ParserOptions options,
	byte[] buffer,
	int startIndex,
	int length,
	out ContentType type
)

Parameters

options  ParserOptions
The parser options.
buffer  Byte
The input buffer.
startIndex  Int32
The starting index of the input buffer.
length  Int32
The number of bytes in the input buffer to parse.
type  ContentType
The parsed content type.

Return Value

Boolean
true if the content type was successfully parsed; otherwise, false.
Exceptions
ExceptionCondition
ArgumentNullException

options is null.

-or-

buffer is null.

ArgumentOutOfRangeExceptionstartIndex and length do not specify a valid range in the byte array.
Remarks
Parses a Content-Type value from the supplied buffer starting at the given index and spanning across the specified number of bytes.
See Also