BuildMaster SDK Reference
Version:

CopyToAsync(System.IO.Stream destination, int bufferSize, System.Threading.CancellationToken cancellationToken) Method

Asynchronously reads the bytes from the current stream and writes them to another stream, using a specified buffer size and cancellation token.

Syntax

public virtual System.Threading.Tasks.Task CopyToAsync(System.IO.Stream destination, int bufferSize, System.Threading.CancellationToken cancellationToken)

Parameters

destination
Type: System.IO.Stream

The stream to which the contents of the current stream will be copied.

bufferSize
Type: int

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 System.Threading.CancellationToken.None.

Returns

A task that represents the asynchronous copy operation.