FileBufferingReadStream.CopyToAsync(Stream, Int32, CancellationToken) Method

Definition

Asynchronously reads the bytes from the current stream and writes them to another stream, using a specified buffer size and cancellation token. Both streams positions are advanced by the number of bytes copied.

C#
public override System.Threading.Tasks.Task CopyToAsync (System.IO.Stream destination, int bufferSize, System.Threading.CancellationToken cancellationToken);

Parameters

destination
Stream
bufferSize
Int32
cancellationToken
CancellationToken

Returns

Applies to

Product Versions
ASP.NET Core 5.0, 6.0, 7.0, 8.0, 9.0