Click or drag to resize
MimeKit

ICancellableStream Interface

An interface allowing for a cancellable stream reading operation.

Namespace: MimeKit.IO
Assembly: MimeKit (in MimeKit.dll) Version: 4.3.0
Syntax
C#
public interface ICancellableStream

The ICancellableStream type exposes the following members.

Methods
 NameDescription
Public methodFlush Clear all buffers for this stream and causes any buffered data to be written to the underlying device.
Public methodRead Read a sequence of bytes from the stream and advances the position within the stream by the number of bytes read.
Public methodWrite Write a sequence of bytes to the stream and advances the current position within this stream by the number of bytes written.
Top
Remarks

This interface is meant to extend the functionality of a Stream, allowing the MimeParser to have much finer-grained canellability.

When a custom stream implementation also implements this interface, the MimeParser will opt to use this interface instead of the normal Read(Byte, Int32, Int32) API to read data from the stream.

This is really useful when parsing a message or other MIME entity directly from a network-based stream.

See Also