C# Class MailKit.Net.Pop3.Pop3Stream

A stream for communicating with a POP3 server.
A stream capable of reading data line-by-line (Pop3StreamMode.Line) or by raw byte streams (Pop3StreamMode.Data).
Inheritance: Stream
Afficher le fichier Open project: jstedfast/MailKit Class Usage Examples

Méthodes publiques

Méthode Description
Flush ( ) : void

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

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

Flush ( CancellationToken cancellationToken ) : void

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

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

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

Initializes a new instance of the MailKit.Net.Pop3.Pop3Stream class.

Creates a new Pop3Stream.

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.

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.

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

Seek ( long offset, SeekOrigin origin ) : long

Sets the position within the current stream.

SetLength ( long value ) : void

Sets the length of the stream.

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.

Méthodes protégées

Méthode Description
Dispose ( bool disposing ) : void

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

Private Methods

Méthode Description
CheckDisposed ( ) : void
NeedInput ( byte inptr, int inputLeft ) : bool
Poll ( SelectMode mode, CancellationToken cancellationToken ) : void
ReadAhead ( CancellationToken cancellationToken ) : int
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.

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

Method Details

Dispose() protected méthode

Releases the unmanaged resources used by the Pop3Stream 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.
Résultat void

Flush() public méthode

Clears all buffers for this stream and causes any buffered data to be written to the underlying device.
Clears all 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
Résultat void

Flush() public méthode

Clears all buffers for this stream and causes any buffered data to be written to the underlying device.
Clears all 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 CancellationToken The cancellation token.
Résultat void

Pop3Stream() public méthode

Initializes a new instance of the MailKit.Net.Pop3.Pop3Stream class.
Creates a new Pop3Stream.
public Pop3Stream ( 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.
Résultat System

Read() public méthode

Reads a sequence of bytes from the stream and advances the position within the stream by the number of bytes 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 line 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.
Résultat int

Read() public méthode

Reads a sequence of bytes from the stream and advances the position within the stream by the number of bytes 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 line 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 CancellationToken The cancellation token.
Résultat int

Seek() public méthode

Sets the position within the current stream.
/// 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.
Résultat long

SetLength() public méthode

Sets the length of the stream.
/// The stream does not support setting the length. ///
public SetLength ( long value ) : void
value long The desired length of the stream in bytes.
Résultat void

Write() public méthode

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.
Résultat void

Write() public méthode

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 CancellationToken The cancellation token.
Résultat void