Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ CopyToAsync() [4/4]

override Task System.IO.Strategies.Net5CompatFileStreamStrategy.CopyToAsync ( Stream destination,
int bufferSize,
CancellationToken cancellationToken )
inlinevirtual

Reimplemented from System.IO.Stream.

Definition at line 1171 of file Net5CompatFileStreamStrategy.cs.

1172 {
1173 if (!_useAsyncIO)
1174 {
1175 return base.CopyToAsync(destination, bufferSize, cancellationToken);
1176 }
1178 {
1179 ThrowHelper.ThrowObjectDisposedException_FileClosed();
1180 }
1181 if (!CanRead)
1182 {
1183 ThrowHelper.ThrowNotSupportedException_UnreadableStream();
1184 }
1185 if (cancellationToken.IsCancellationRequested)
1186 {
1187 return Task.FromCanceled<int>(cancellationToken);
1188 }
1190 }
async Task AsyncModeCopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken)
static Task FromCanceled(CancellationToken cancellationToken)
Definition Task.cs:3363

References System.IO.Strategies.Net5CompatFileStreamStrategy._fileHandle, System.IO.Strategies.Net5CompatFileStreamStrategy._useAsyncIO, System.IO.Strategies.Net5CompatFileStreamStrategy.AsyncModeCopyToAsync(), System.cancellationToken, System.IO.Strategies.Net5CompatFileStreamStrategy.CanRead, System.destination, System.Threading.Tasks.Task< TResult >.FromCanceled(), System.Runtime.InteropServices.SafeHandle.IsClosed, System.ThrowHelper.ThrowNotSupportedException_UnreadableStream(), and System.ThrowHelper.ThrowObjectDisposedException_FileClosed().