Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
AsyncWindowsFileStreamStrategy.cs
Go to the documentation of this file.
4
6
8{
9 internal override bool IsAsync => true;
10
12 : base(handle, access)
13 {
14 }
15
16 internal AsyncWindowsFileStreamStrategy(string path, FileMode mode, FileAccess access, FileShare share, FileOptions options, long preallocationSize)
17 : base(path, mode, access, share, options, preallocationSize)
18 {
19 }
20
22 {
24 {
26 }
27 if (!CanRead)
28 {
30 }
31 if (cancellationToken.IsCancellationRequested)
32 {
34 }
36 }
37
39 {
40 try
41 {
42 await FileStreamHelpers.AsyncModeCopyToAsync(_fileHandle, CanSeek, _filePosition, destination, bufferSize, cancellationToken).ConfigureAwait(continueOnCapturedContext: false);
43 }
44 finally
45 {
47 {
49 }
50 }
51 }
52}
AsyncWindowsFileStreamStrategy(SafeFileHandle handle, FileAccess access)
async Task AsyncModeCopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken)
override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken)
AsyncWindowsFileStreamStrategy(string path, FileMode mode, FileAccess access, FileShare share, FileOptions options, long preallocationSize)
static unsafe async Task AsyncModeCopyToAsync(SafeFileHandle handle, bool canSeek, long filePosition, Stream destination, int bufferSize, CancellationToken cancellationToken)
static Task FromCanceled(CancellationToken cancellationToken)
Definition Task.cs:3363
static void ThrowObjectDisposedException_FileClosed()
static void ThrowNotSupportedException_UnreadableStream()