C# Класс MailKit.Net.Imap.ImapStream

Наследование: Stream, ICancellableStream
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
CheckDisposed ( ) : void
Flush ( ) : void

Clears all output buffers for this stream and causes any buffered data to be written to the underlying device.

Clears all output buffers for this stream and causes any buffered data to be written to the underlying device.

Flush ( CancellationToken cancellationToken ) : void

Clears all output buffers for this stream and causes any buffered data to be written to the underlying device.

Clears all output buffers for this stream and causes any buffered data to be written to the underlying device.

ImapStream ( Stream source, StreamSocket socket, IProtocolLogger protocolLogger ) : System

Initializes a new instance of the MailKit.Net.Imap.ImapStream class.

Creates a new ImapStream.

Poll ( SelectMode mode, CancellationToken cancellationToken ) : void
Read ( byte buffer, int offset, int count ) : int

Reads a sequence of bytes from the stream and advances the position within the stream by the number of bytes read.

Read ( byte buffer, int offset, int count, CancellationToken cancellationToken ) : int

Reads a sequence of bytes from the stream and advances the position within the stream by the number of bytes read.

ReadToken ( CancellationToken cancellationToken ) : MailKit.Net.Imap.ImapToken

Reads the next available token from the stream.

ReadToken ( string specials, CancellationToken cancellationToken ) : MailKit.Net.Imap.ImapToken

Reads the next available token from the stream.

Seek ( long offset, SeekOrigin origin ) : long

Sets the position within the current stream.

It is not possible to seek within a ImapStream.

SetLength ( long value ) : void

Sets the length of the stream.

It is not possible to set the length of a ImapStream.

UngetToken ( MailKit.Net.Imap.ImapToken token ) : void

Ungets a token.

Write ( byte buffer, int offset, int count ) : void

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

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

Write ( byte buffer, int offset, int count, CancellationToken cancellationToken ) : void

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

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

Защищенные методы

Метод Описание
Dispose ( bool disposing ) : void

Releases the unmanaged resources used by the ImapStream and optionally releases the managed resources.

Releases the unmanaged resources used by the ImapStream and optionally releases the managed resources.

Приватные методы

Метод Описание
IsAtom ( byte c, string specials ) : bool
IsCtrl ( byte c ) : bool
IsWhiteSpace ( byte c ) : bool
ReadAhead ( int atleast, CancellationToken cancellationToken ) : int
ReadAtomString ( byte inbuf, bool flag, string specials, CancellationToken cancellationToken ) : string
ReadAtomToken ( byte inbuf, string specials, CancellationToken cancellationToken ) : MailKit.Net.Imap.ImapToken
ReadFlagToken ( byte inbuf, string specials, CancellationToken cancellationToken ) : MailKit.Net.Imap.ImapToken
ReadLine ( byte &buffer, int &offset, int &count, CancellationToken cancellationToken ) : bool

Reads a single line of input from the stream.

This method should be called in a loop until it returns true.

ReadLiteralToken ( byte inbuf, CancellationToken cancellationToken ) : MailKit.Net.Imap.ImapToken
ReadQuotedStringToken ( byte inbuf, CancellationToken cancellationToken ) : MailKit.Net.Imap.ImapToken
ValidateArguments ( byte buffer, int offset, int count ) : void

Описание методов

CheckDisposed() публичный Метод

public CheckDisposed ( ) : void
Результат void

Dispose() защищенный Метод

Releases the unmanaged resources used by the ImapStream and optionally releases the managed resources.
Releases the unmanaged resources used by the ImapStream and optionally releases the managed resources.
protected Dispose ( bool disposing ) : void
disposing bool true to release both managed and unmanaged resources; /// false to release only the unmanaged resources.
Результат void

Flush() публичный Метод

Clears all output buffers for this stream and causes any buffered data to be written to the underlying device.
Clears all output buffers for this stream and causes any buffered data to be written to the underlying device.
/// The stream has been disposed. /// /// The stream does not support writing. /// /// An I/O error occurred. ///
public Flush ( ) : void
Результат void

Flush() публичный Метод

Clears all output buffers for this stream and causes any buffered data to be written to the underlying device.
Clears all output buffers for this stream and causes any buffered data to be written to the underlying device.
/// The stream has been disposed. /// /// The stream does not support writing. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. ///
public Flush ( CancellationToken cancellationToken ) : void
cancellationToken System.Threading.CancellationToken The cancellation token.
Результат void

ImapStream() публичный Метод

Initializes a new instance of the MailKit.Net.Imap.ImapStream class.
Creates a new ImapStream.
public ImapStream ( Stream source, StreamSocket socket, IProtocolLogger protocolLogger ) : System
source Stream The underlying network stream.
socket Windows.Networking.Sockets.StreamSocket The underlying network socket.
protocolLogger IProtocolLogger The protocol logger.
Результат System

Poll() публичный Метод

public Poll ( SelectMode mode, CancellationToken cancellationToken ) : void
mode SelectMode
cancellationToken System.Threading.CancellationToken
Результат void

Read() публичный Метод

Reads a sequence of bytes from the stream and advances the position within the stream by the number of bytes read.
/// is null. /// /// is less than zero or greater than the length of . /// -or- /// The is not large enough to contain bytes strting /// at the specified . /// /// The stream has been disposed. /// /// The stream is in token mode (see ). /// /// An I/O error occurred. ///
public Read ( byte buffer, int offset, int count ) : int
buffer byte The buffer.
offset int The buffer offset.
count int The number of bytes to read.
Результат int

Read() публичный Метод

Reads a sequence of bytes from the stream and advances the position within the stream by the number of bytes read.
/// is null. /// /// is less than zero or greater than the length of . /// -or- /// The is not large enough to contain bytes strting /// at the specified . /// /// The stream has been disposed. /// /// The stream is in token mode (see ). /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. ///
public Read ( byte buffer, int offset, int count, CancellationToken cancellationToken ) : int
buffer byte The buffer.
offset int The buffer offset.
count int The number of bytes to read.
cancellationToken System.Threading.CancellationToken The cancellation token.
Результат int

ReadToken() публичный Метод

Reads the next available token from the stream.
/// The stream has been disposed. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. ///
public ReadToken ( CancellationToken cancellationToken ) : MailKit.Net.Imap.ImapToken
cancellationToken System.Threading.CancellationToken The cancellation token.
Результат MailKit.Net.Imap.ImapToken

ReadToken() публичный Метод

Reads the next available token from the stream.
/// The stream has been disposed. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. ///
public ReadToken ( string specials, CancellationToken cancellationToken ) : MailKit.Net.Imap.ImapToken
specials string A list of characters that are not legal in bare string tokens.
cancellationToken System.Threading.CancellationToken The cancellation token.
Результат MailKit.Net.Imap.ImapToken

Seek() публичный Метод

Sets the position within the current stream.
It is not possible to seek within a ImapStream.
/// The stream does not support seeking. ///
public Seek ( long offset, SeekOrigin origin ) : long
offset long The offset into the stream relative to the .
origin SeekOrigin The origin to seek from.
Результат long

SetLength() публичный Метод

Sets the length of the stream.
It is not possible to set the length of a ImapStream.
/// The stream does not support setting the length. ///
public SetLength ( long value ) : void
value long The desired length of the stream in bytes.
Результат void

UngetToken() публичный Метод

Ungets a token.
public UngetToken ( MailKit.Net.Imap.ImapToken token ) : void
token MailKit.Net.Imap.ImapToken The token.
Результат void

Write() публичный Метод

Writes a sequence of bytes to the stream and advances the current position within this stream by the number of bytes written.
Writes a sequence of bytes to the stream and advances the current position within this stream by the number of bytes written.
/// is null. /// /// is less than zero or greater than the length of . /// -or- /// The is not large enough to contain bytes strting /// at the specified . /// /// The stream has been disposed. /// /// The stream does not support writing. /// /// An I/O error occurred. ///
public Write ( byte buffer, int offset, int count ) : void
buffer byte The buffer to write.
offset int The offset of the first byte to write.
count int The number of bytes to write.
Результат void

Write() публичный Метод

Writes a sequence of bytes to the stream and advances the current position within this stream by the number of bytes written.
Writes a sequence of bytes to the stream and advances the current position within this stream by the number of bytes written.
/// is null. /// /// is less than zero or greater than the length of . /// -or- /// The is not large enough to contain bytes strting /// at the specified . /// /// The stream has been disposed. /// /// The stream does not support writing. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. ///
public Write ( byte buffer, int offset, int count, CancellationToken cancellationToken ) : void
buffer byte The buffer to write.
offset int The offset of the first byte to write.
count int The number of bytes to write.
cancellationToken System.Threading.CancellationToken The cancellation token.
Результат void