StreamExtensionsCopyToAsync Method (Stream, Stream, Int32, CancellationToken) |
Namespace: Rackspace.Threading
public static Task CopyToAsync( this Stream stream, Stream destination, int bufferSize, CancellationToken cancellationToken )
Exception | Condition |
---|---|
ArgumentNullException |
If stream is . -or- If destination is . |
ArgumentOutOfRangeException |
If bufferSize is negative or zero. |
ObjectDisposedException |
If stream is disposed. -or- If destination is disposed. |
NotSupportedException |
If stream does not support reading. -or- If destination does not support writing. |
If the operation is canceled before it completes, the returned task contains the Canceled value for the Status property.
Copying begins at the current position in stream.