BuildMaster SDK Reference
Version:

CopyToAsync(System.IO.Stream source, System.IO.Stream destination, System.Action<long> reportProgress) Method

Asynchronously reads the bytes from the current stream and writes them to another stream, using a progress reporting delegate.

Syntax

public static System.Threading.Tasks.Task CopyToAsync(System.IO.Stream source, System.IO.Stream destination, Action<long> reportProgress)

Parameters

source
Type: System.IO.Stream

The stream to copy from.

destination
Type: System.IO.Stream

The stream to copy to.

reportProgress
Type: System.Action<long>

Delegate which will be invoked periodically with the number of bytes copied so far as its argument.

Returns

A task that represents the asynchronous copy operation.

Exceptions

System.ArgumentNullException

source is null (Nothing in Visual Basic) or destination is null (Nothing in Visual Basic).

System.ObjectDisposedException

Either the source stream or the destination stream is disposed.

System.NotSupportedException

The source stream does not support reading, or the destination stream does not support writing.