IOUtilitiesCopyToAsync Method (Stream, Stream, CancellationToken, Int64, Int32) |
Reads the bytes from the current stream and writes them to another stream.
Namespace:
ShellBoost.Core.Utilities
Assembly:
ShellBoost.Core (in ShellBoost.Core.dll) Version: 1.8.3.0
Syntax public static Task<long> CopyToAsync(
this Stream input,
Stream output,
CancellationToken cancellationToken,
long count = 9223372036854775807,
int bufferSize = 81920
)
Parameters
- input
- Type: System.IOStream
The stream to read from. - output
- Type: System.IOStream
The stream to write to. - cancellationToken
- Type: System.ThreadingCancellationToken
The token to monitor for cancellation requests. - count (Optional)
- Type: SystemInt64
The maximum number of bytes to copy. - bufferSize (Optional)
- Type: SystemInt32
The size of the buffer. This value must be greater than zero. The default size is 81920.
Return Value
Type:
TaskInt64The number of bytes read and written.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
Stream. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
Exceptions See Also