Table of Contents

Method CopyToSyncAsAsync

Namespace
KZDev.PerfUtils
Assembly
KZDev.PerfUtils.dll

CopyToSyncAsAsync(Stream, int, CancellationToken)

For known destination classes that are in-memory, we can optimize the copy operation by copying synchronously instead of asynchronously.

protected Task CopyToSyncAsAsync(Stream destination, int bufferSize, CancellationToken cancellationToken)

Parameters

destination Stream

The destination stream to copy the contents of this stream to.

bufferSize int

The size of the buffer to use for copying the stream contents.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

Task