Click or drag to resize

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.1.26791.0-Beta2
Syntax
public static Task CopyToAsync(
	this Stream source,
	Stream destination,
	int bufferSize,
	long count,
	CancellationToken cancellationToken = null
)

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: Task

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).
See Also