Click or drag to resize

DelegatingStreamWriteAsync Method (Byte, Int32, Int32, 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.

Namespace:  MongoDB.Driver.GridFS
Assembly:  MongoDB.Driver.GridFS (in MongoDB.Driver.GridFS.dll) Version: 2.12.2+a4a3888f4fb51bb518b1eb5002effc2d47f2ea6a
public override Task WriteAsync(
	byte[] buffer,
	int offset,
	int count,
	CancellationToken cancellationToken


Type: SystemByte
The buffer to write data from.
Type: SystemInt32
The zero-based byte offset in buffer from which to begin copying bytes to the stream.
Type: SystemInt32
The maximum number of bytes to write.
Type: System.ThreadingCancellationToken
The token to monitor for cancellation requests. The default value is None.

Return Value

Type: Task
A task that represents the asynchronous write operation.
ArgumentNullExceptionbuffer is .
ArgumentOutOfRangeExceptionoffset or count is negative.
ArgumentExceptionThe sum of offset and count is larger than the buffer length.
NotSupportedExceptionThe stream does not support writing.
ObjectDisposedExceptionThe stream has been disposed.
InvalidOperationExceptionThe stream is currently in use by a previous write operation.
See Also