DelegatingStreamCopyToAsync Method (Stream, Int32, CancellationToken) |
Asynchronously reads the bytes from the current stream and writes them to another stream, using a specified buffer size and cancellation token.
Namespace:
MongoDB.Driver.GridFS
Assembly:
MongoDB.Driver.GridFS (in MongoDB.Driver.GridFS.dll) Version: 2.16.0+eeafbea0921243a5868b81984e1083a07c1f75bc
Syntax public override Task CopyToAsync(
Stream destination,
int bufferSize,
CancellationToken cancellationToken
)
Public Overrides Function CopyToAsync (
destination As Stream,
bufferSize As Integer,
cancellationToken As CancellationToken
) As Task
abstract CopyToAsync :
destination : Stream *
bufferSize : int *
cancellationToken : CancellationToken -> Task
override CopyToAsync :
destination : Stream *
bufferSize : int *
cancellationToken : CancellationToken -> Task
Parameters
- destination
- Type: System.IOStream
The stream to which the contents of the current stream will be copied. - bufferSize
- Type: SystemInt32
The size, in bytes, of the buffer. This value must be greater than zero. The default size is 81920. - cancellationToken
- Type: System.ThreadingCancellationToken
The token to monitor for cancellation requests. The default value is None.
Return Value
Type:
TaskA task that represents the asynchronous copy operation.
Exceptions See Also