Click or drag to resize
MimeKit

FilteredStreamWriteAsync(Byte, Int32, Int32, CancellationToken) Method

Asynchronously write a sequence of bytes to the stream and advances the current position within this stream by the number of bytes written.

Namespace: MimeKit.IO
Assembly: MimeKit (in MimeKit.dll) Version: 4.3.0
Syntax
C#
public override Task WriteAsync(
	byte[] buffer,
	int offset,
	int count,
	CancellationToken cancellationToken
)

Parameters

buffer  Byte
The buffer to write.
offset  Int32
The offset of the first byte to write.
count  Int32
The number of bytes to write.
cancellationToken  CancellationToken
The cancellation token.

Return Value

Task
A task that represents the asynchronous write operation.
Exceptions
ExceptionCondition
ArgumentNullExceptionbuffer is null.
ArgumentOutOfRangeException

offset is less than zero or greater than the length of buffer.

-or-

The buffer is not large enough to contain count bytes starting at the specified offset.

ObjectDisposedException The stream has been disposed.
NotSupportedException The stream does not support writing.
OperationCanceledException The operation was canceled via the cancellation token.
IOException An I/O error occurred.
Remarks
Filters the provided buffer through each of the filters before finally writing the result to the underlying Source stream.
See Also