<PackageReference Include="Microsoft.Azure.Storage.Common" Version="11.1.3" />

Microsoft.Azure.Storage.Core.Util.AsyncStreamCopier<T>

public AsyncStreamCopier(Stream src, Stream dest, ExecutionState<T> state, IBufferManager bufferManager, int? buffSize, ChecksumRequested calculateChecksum, StreamDescriptor streamCopyState)

Creates and initializes a new asynchronous copy operation.

public void Dispose()

Cleans up references. To end a copy operation, call Cancel() on the ExecutionState.

protected virtual void Dispose(bool disposing)

public Task StartCopyStream(Action<ExecutionState<T>> completedDelegate, long? copyLength, long? maxLength, CancellationToken cancellationToken)

Begins a stream copy operation. This method wraps the StartCopyStreamAsync method, presenting a different API for it. As we update the library to be more task-based, callers should gradually move to StartCopyStreamAsync.

public Task StartCopyStreamAsync(long? copyLength, long? maxLength, CancellationToken cancellationToken)

This method performs the stream copy in an asynchronous, task-based manner. To do the stream copy in a begin-with-callback style (the old style), use StartCopyStream, which wraps this method, does appropriate cancellation/exception handling, and calls the callback. This method sets up cancellation, and will cancel if either the timeout on the execution state expires, or cancel() is called directly (on the ExecutionState). This method does not set the ExceptionRef on the ExecutionState, or abort the request.