 | AutoResetStream.CopyToAsync 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:
BionicCode.Utilities.Net.Standard.IO
Assembly:
BionicCode.Utilities.Net.Standard (in BionicCode.Utilities.Net.Standard.dll) Version: 1.0.4
Syntaxfunction CopyToAsync(destination, bufferSize, cancellationToken);
Parameters
- destination
- Type: System.IO.Stream
The stream to which the contents of the current stream will be copied. - bufferSize
- Type: System.Int32
The size, in bytes, of the buffer. This value must be greater than zero. The default size is 81920. - cancellationToken
- Type: System.Threading.CancellationToken
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