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

Classes

struct  _003CReadAsyncSlowPath_003Ed__39
 
struct  _003CWriteAsyncSlowPath_003Ed__50
 

Public Member Functions

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

 BufferedFileStreamStrategy (FileStreamStrategy strategy, int bufferSize)
 
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 bool CanSeek [get]
 
override long Length [get]
 
override long Position [get, set]
 
override bool IsAsync [get]
 
override bool IsClosed [get]
 
override string Name [get]
 
override SafeFileHandle SafeFileHandle [get]
 
IntPtr Handle [get]
 
virtual bool CanTimeout [get]
 
virtual int ReadTimeout [get, set]
 
virtual int WriteTimeout [get, set]
 

Private Member Functions

 ~BufferedFileStreamStrategy ()
 
int ReadSpan (Span< byte > destination, ArraySegment< byte > arraySegment)
 
int ReadByteSlow ()
 
async ValueTask< int > ReadFromNonSeekableAsync (Memory< byte > destination, CancellationToken cancellationToken)
 
ValueTask< int > ReadAsyncSlowPath (Task semaphoreLockTask, Memory< byte > buffer, CancellationToken cancellationToken)
 
void WriteSpan (ReadOnlySpan< byte > source, ArraySegment< byte > arraySegment)
 
void WriteByteSlow (byte value)
 
async ValueTask WriteToNonSeekableAsync (ReadOnlyMemory< byte > source, CancellationToken cancellationToken)
 
ValueTask WriteAsyncSlowPath (Task semaphoreLockTask, ReadOnlyMemory< byte > source, CancellationToken cancellationToken)
 
async Task FlushAsyncInternal (CancellationToken cancellationToken)
 
async Task CopyToAsyncCore (Stream destination, int bufferSize, CancellationToken cancellationToken)
 
void FlushRead ()
 
void FlushWrite ()
 
void ClearReadBufferBeforeWrite ()
 
void EnsureNotClosed ()
 
void EnsureCanSeek ()
 
void EnsureCanRead ()
 
void EnsureCanWrite ()
 
void EnsureBufferAllocated ()
 
void AllocateBuffer ()
 
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

readonly FileStreamStrategy _strategy
 
readonly int _bufferSize
 
byte[] _buffer
 
int _writePos
 
int _readPos
 
int _readLen
 
Task< int > _lastSyncCompletedReadTask
 

Detailed Description

Definition at line 11 of file BufferedFileStreamStrategy.cs.


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