ICancellableStream Interface

An interface allowing for a cancellable stream reading operation.

Definition

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

Remarks

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

When a custom stream implementation also implements this interface, the IMimeParser 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.

Methods

Flush Clear all buffers for this stream and causes any buffered data to be written to the underlying device.
Read Read a sequence of bytes from the stream and advances the position within the stream by the number of bytes read.
Write Write a sequence of bytes to the stream and advances the current position within this stream by the number of bytes written.

See Also