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

Public Member Functions

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

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

Stream UnderlyingStream [get]
 
int BufferSize [get]
 
override bool CanRead [get]
 
override bool CanWrite [get]
 
override bool CanSeek [get]
 
override long Length [get]
 
override long Position [get, set]
 
virtual bool CanTimeout [get]
 
virtual int ReadTimeout [get, set]
 
virtual int WriteTimeout [get, set]
 

Private Member Functions

void EnsureNotClosed ()
 
void EnsureCanSeek ()
 
void EnsureCanRead ()
 
void EnsureCanWrite ()
 
void EnsureShadowBufferAllocated ()
 
void EnsureBufferAllocated ()
 
async Task FlushAsyncInternal (CancellationToken cancellationToken)
 
void FlushRead ()
 
void ClearReadBufferBeforeWrite ()
 
void FlushWrite ()
 
async ValueTask FlushWriteAsync (CancellationToken cancellationToken)
 
int ReadFromBuffer (byte[] buffer, int offset, int count)
 
int ReadFromBuffer (Span< byte > destination)
 
int ReadFromBuffer (byte[] buffer, int offset, int count, out Exception error)
 
Task< int > LastSyncCompletedReadTask (int val)
 
async ValueTask< int > ReadFromUnderlyingStreamAsync (Memory< byte > buffer, CancellationToken cancellationToken, int bytesAlreadySatisfied, Task semaphoreLockTask)
 
int ReadByteSlow ()
 
void WriteToBuffer (byte[] buffer, ref int offset, ref int count)
 
int WriteToBuffer (ReadOnlySpan< byte > buffer)
 
async ValueTask WriteToUnderlyingStreamAsync (ReadOnlyMemory< byte > buffer, CancellationToken cancellationToken, Task semaphoreLockTask)
 
void WriteByteSlow (byte value)
 
async Task CopyToAsyncCore (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

Stream _stream
 
byte[] _buffer
 
readonly int _bufferSize
 
int _readPos
 
int _readLen
 
int _writePos
 
Task< int > _lastSyncCompletedReadTask
 

Detailed Description

Definition at line 6 of file BufferedStream.cs.


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