StreamCopyCopyToAsync Method |
IT Hit User File System
Asynchronously copies specified number of bytes from current stream to destination stream, using a specified buffer size.
Namespace:
ITHit.FileSystem.Windows
Assembly:
ITHit.FileSystem.Windows (in ITHit.FileSystem.Windows.dll) Version: 8.4.27341.0
Syntax public static Task CopyToAsync(
this Stream source,
Stream destination,
int bufferSize,
long count,
CancellationToken cancellationToken = null
)
<ExtensionAttribute>
Public Shared Function CopyToAsync (
source As Stream,
destination As Stream,
bufferSize As Integer,
count As Long,
Optional cancellationToken As CancellationToken = Nothing
) As Task
public:
[ExtensionAttribute]
static Task^ CopyToAsync(
Stream^ source,
Stream^ destination,
int bufferSize,
long long count,
CancellationToken cancellationToken = nullptr
)
[<ExtensionAttribute>]
static member CopyToAsync :
source : Stream *
destination : Stream *
bufferSize : int *
count : int64 *
?cancellationToken : CancellationToken
(* Defaults:
let _cancellationToken = defaultArg cancellationToken null
*)
-> Task
Parameters
- source
- Type: System.IOStream
Source stream. - destination
- Type: System.IOStream
The stream to which the contents of the current file stream will be copied. - bufferSize
- Type: SystemInt32
The size, in bytes, of the buffer. This value must be greater than zero. - count
- Type: SystemInt64
Number of bytes to copy. - cancellationToken (Optional)
- Type: System.ThreadingCancellationToken
The token to monitor for cancellation requests.
Return Value
Type:
TaskUsage 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).
See Also