private async Task AsyncModeCopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) { Debug.Assert(!_fileHandle.IsClosed, "!_handle.IsClosed"); Debug.Assert(CanRead, "_parent.CanRead"); bool canSeek = CanSeek; if (canSeek) { VerifyOSHandlePosition(); } try { await FileStreamHelpers .AsyncModeCopyToAsync(_fileHandle, _path, canSeek, _filePosition, destination, bufferSize, cancellationToken) .ConfigureAwait(false); } finally { // Make sure the stream's current position reflects where we ended up if (!_fileHandle.IsClosed && CanSeek) { SeekCore(_fileHandle, 0, SeekOrigin.End); } } }