Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
System.IO.Strategies.Net5CompatFileStreamStrategy Class Referencesealed

Classes

class  CompletionSource
 
class  MemoryFileStreamCompletionSource
 

Public Member Functions

override Task FlushAsync (CancellationToken cancellationToken)
 
override int Read (byte[] buffer, int offset, int count)
 
override int Read (Span< byte > buffer)
 
override Task< int > ReadAsync (byte[] buffer, int offset, int count, CancellationToken cancellationToken)
 
override ValueTask< int > ReadAsync (Memory< byte > buffer, CancellationToken cancellationToken=default(CancellationToken))
 
override void Write (byte[] buffer, int offset, int count)
 
override void Write (ReadOnlySpan< byte > buffer)
 
override Task WriteAsync (byte[] buffer, int offset, int count, CancellationToken cancellationToken)
 
override ValueTask WriteAsync (ReadOnlyMemory< byte > buffer, CancellationToken cancellationToken=default(CancellationToken))
 
override void Flush ()
 
override int ReadByte ()
 
override void WriteByte (byte value)
 
override IAsyncResult BeginRead (byte[] buffer, int offset, int count, AsyncCallback callback, object state)
 
override IAsyncResult BeginWrite (byte[] buffer, int offset, int count, AsyncCallback callback, object state)
 
override int EndRead (IAsyncResult asyncResult)
 
override void EndWrite (IAsyncResult asyncResult)
 
override async ValueTask DisposeAsync ()
 
override void SetLength (long value)
 
override long Seek (long offset, SeekOrigin origin)
 
override Task CopyToAsync (Stream destination, int bufferSize, CancellationToken cancellationToken)
 
void CopyTo (Stream destination)
 
virtual void CopyTo (Stream destination, int bufferSize)
 
Task CopyToAsync (Stream destination)
 
Task CopyToAsync (Stream destination, int bufferSize)
 
Task CopyToAsync (Stream destination, CancellationToken cancellationToken)
 
void Dispose ()
 
virtual void Close ()
 
Task FlushAsync ()
 
virtual IAsyncResult BeginRead (byte[] buffer, int offset, int count, AsyncCallback? callback, object? state)
 
Task< int > ReadAsync (byte[] buffer, int offset, int count)
 
virtual IAsyncResult BeginWrite (byte[] buffer, int offset, int count, AsyncCallback? callback, object? state)
 
Task WriteAsync (byte[] buffer, int offset, int count)
 
object GetLifetimeService ()
 
virtual object InitializeLifetimeService ()
 

Static Public Member Functions

static Stream Synchronized (Stream stream)
 

Static Public Attributes

static readonly Stream Null = new NullStream()
 

Protected Member Functions

override void Dispose (bool disposing)
 
SemaphoreSlim EnsureAsyncActiveSemaphoreInitialized ()
 
virtual WaitHandle CreateWaitHandle ()
 
virtual void ObjectInvariant ()
 
MarshalByRefObject MemberwiseClone (bool cloneIdentity)
 

Static Protected Member Functions

static void ValidateBufferArguments (byte[] buffer, int offset, int count)
 
static void ValidateCopyToArguments (Stream destination, int bufferSize)
 

Protected Attributes

SemaphoreSlim _asyncActiveSemaphore
 

Package Functions

 Net5CompatFileStreamStrategy (SafeFileHandle handle, FileAccess access, int bufferSize, bool isAsync)
 
 Net5CompatFileStreamStrategy (string path, FileMode mode, FileAccess access, FileShare share, int bufferSize, FileOptions options, long preallocationSize)
 
override void DisposeInternal (bool disposing)
 
override void Flush (bool flushToDisk)
 
override void Lock (long position, long length)
 
override void Unlock (long position, long length)
 
Task< int > BeginReadInternal (byte[] buffer, int offset, int count, AsyncCallback callback, object state, bool serializeAsynchronously, bool apm)
 
Task BeginWriteInternal (byte[] buffer, int offset, int count, AsyncCallback callback, object state, bool serializeAsynchronously, bool apm)
 

Properties

override bool CanRead [get]
 
override bool CanWrite [get]
 
override SafeFileHandle SafeFileHandle [get]
 
override string Name [get]
 
override bool IsAsync [get]
 
override long Position [get, set]
 
override bool IsClosed [get]
 
bool HasActiveBufferOperation [get]
 
override bool CanSeek [get]
 
override long Length [get]
 
IntPtr Handle [get]
 
virtual bool CanTimeout [get]
 
virtual int ReadTimeout [get, set]
 
virtual int WriteTimeout [get, set]
 

Private Member Functions

 ~Net5CompatFileStreamStrategy ()
 
Task< int > ReadAsyncTask (byte[] buffer, int offset, int count, CancellationToken cancellationToken)
 
void VerifyOSHandlePosition ()
 
void PrepareForReading ()
 
long SeekCore (SafeFileHandle fileHandle, long offset, SeekOrigin origin, bool closeInvalidHandle=false)
 
byte[] GetBuffer ()
 
void FlushInternalBuffer ()
 
void FlushReadBuffer ()
 
void PrepareForWriting ()
 
void OnBufferAllocated ()
 
void Init (FileMode mode, string originalPath, FileOptions options)
 
void InitFromHandle (SafeFileHandle handle, FileAccess access, bool useAsyncIO)
 
void InitFromHandleImpl (SafeFileHandle handle, bool useAsyncIO)
 
Task FlushWriteAsync (CancellationToken cancellationToken)
 
void FlushWriteBufferForWriteByte ()
 
void FlushWriteBuffer (bool calledFromFinalizer=false)
 
void SetLengthCore (long value)
 
int ReadSpan (Span< byte > destination)
 
int FillReadBufferForReadByte ()
 
unsafe int ReadNative (Span< byte > buffer)
 
CompletionSource CompareExchangeCurrentOverlappedOwner (CompletionSource newSource, CompletionSource existingSource)
 
void WriteSpan (ReadOnlySpan< byte > source)
 
unsafe void WriteCore (ReadOnlySpan< byte > source)
 
Task< int > ReadAsyncInternal (Memory< byte > destination, CancellationToken cancellationToken, out int synchronousResult)
 
unsafe Task< int > ReadNativeAsync (Memory< byte > destination, int numBufferedBytesRead, CancellationToken cancellationToken)
 
ValueTask WriteAsyncInternal (ReadOnlyMemory< byte > source, CancellationToken cancellationToken)
 
unsafe Task WriteAsyncInternalCore (ReadOnlyMemory< byte > source, CancellationToken cancellationToken)
 
unsafe int ReadFileNative (SafeFileHandle handle, Span< byte > bytes, NativeOverlapped *overlapped, out int errorCode)
 
unsafe int WriteFileNative (SafeFileHandle handle, ReadOnlySpan< byte > buffer, NativeOverlapped *overlapped, out int errorCode)
 
async Task AsyncModeCopyToAsync (Stream destination, int bufferSize, CancellationToken cancellationToken)
 
bool HasOverriddenBeginEndRead ()
 
bool HasOverriddenBeginEndWrite ()
 
int GetCopyBufferSize ()
 
Task< int > BeginEndReadAsync (byte[] buffer, int offset, int count)
 
void FinishTrackingAsyncOperation (ReadWriteTask task)
 
Task BeginEndWriteAsync (byte[] buffer, int offset, int count)
 

Static Private Member Functions

static void RunReadWriteTaskWhenReady (Task asyncWaiter, ReadWriteTask readWriteTask)
 
static void RunReadWriteTask (ReadWriteTask readWriteTask)
 
static async Task FinishWriteAsync (Task writeTask, byte[] localBuffer)
 

Private Attributes

byte[] _buffer
 
readonly int _bufferLength
 
readonly SafeFileHandle _fileHandle
 
readonly FileAccess _access
 
int _readPos
 
int _readLength
 
int _writePos
 
readonly bool _useAsyncIO
 
Task< int > _lastSynchronouslyCompletedTask
 
long _filePosition
 
bool _exposedHandle
 
long _appendStart
 
Task _activeBufferOperation = Task.CompletedTask
 
PreAllocatedOverlapped _preallocatedOverlapped
 
CompletionSource _currentOverlappedOwner
 

Detailed Description

Definition at line 9 of file Net5CompatFileStreamStrategy.cs.


The documentation for this class was generated from the following file: