Table of Contents

Class DelegatingStream

Namespace
MongoDB.Driver.GridFS
Assembly
MongoDB.Driver.dll

Represents a Stream that delegates all of its operations to a wrapped Stream.

public class DelegatingStream : Stream, IAsyncDisposable, IDisposable
Inheritance
DelegatingStream
Implements
Derived
Inherited Members

Properties

CanRead

When overridden in a derived class, gets a value indicating whether the current stream supports reading.

CanSeek

When overridden in a derived class, gets a value indicating whether the current stream supports seeking.

CanTimeout

Gets a value that determines whether the current stream can time out.

CanWrite

When overridden in a derived class, gets a value indicating whether the current stream supports writing.

Length

When overridden in a derived class, gets the length in bytes of the stream.

Position

When overridden in a derived class, gets or sets the position within the current stream.

ReadTimeout

Gets or sets a value, in milliseconds, that determines how long the stream will attempt to read before timing out.

WriteTimeout

Gets or sets a value, in milliseconds, that determines how long the stream will attempt to write before timing out.

Methods

BeginRead(byte[], int, int, AsyncCallback, object)

Begins an asynchronous read operation. (Consider using ReadAsync(byte[], int, int) instead.)

BeginWrite(byte[], int, int, AsyncCallback, object)

Begins an asynchronous write operation. (Consider using WriteAsync(byte[], int, int) instead.)

Close()

Closes the current stream and releases any resources (such as sockets and file handles) associated with the current stream. Instead of calling this method, ensure that the stream is properly disposed.

CopyToAsync(Stream, int, CancellationToken)

Asynchronously reads the bytes from the current stream and writes them to another stream, using a specified buffer size and cancellation token.

CreateWaitHandle()

Allocates a WaitHandle object.

Dispose(bool)

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

EndRead(IAsyncResult)

Waits for the pending asynchronous read to complete. (Consider using ReadAsync(byte[], int, int) instead.)

EndWrite(IAsyncResult)

Ends an asynchronous write operation. (Consider using WriteAsync(byte[], int, int) instead.)

Equals(object)

Determines whether the specified object is equal to the current object.

Flush()

When overridden in a derived class, clears all buffers for this stream and causes any buffered data to be written to the underlying device.

FlushAsync(CancellationToken)

Asynchronously clears all buffers for this stream, causes any buffered data to be written to the underlying device, and monitors cancellation requests.

GetHashCode()

Serves as the default hash function.

Read(byte[], int, int)

When overridden in a derived class, reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.

ReadAsync(byte[], int, int, CancellationToken)

Asynchronously reads a sequence of bytes from the current stream, advances the position within the stream by the number of bytes read, and monitors cancellation requests.

ReadByte()

Reads a byte from the stream and advances the position within the stream by one byte, or returns -1 if at the end of the stream.

Seek(long, SeekOrigin)

When overridden in a derived class, sets the position within the current stream.

SetLength(long)

When overridden in a derived class, sets the length of the current stream.

ToString()

Returns a string that represents the current object.

Write(byte[], int, int)

When overridden in a derived class, writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.

WriteAsync(byte[], int, int, CancellationToken)

Asynchronously writes a sequence of bytes to the current stream, advances the current position within this stream by the number of bytes written, and monitors cancellation requests.

WriteByte(byte)

Writes a byte to the current position in the stream and advances the position within the stream by one byte.

See Also