Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
System.Runtime.Serialization.Json.JsonEncodingStreamWrapper Class Referencesealed

Public Member Functions

 JsonEncodingStreamWrapper (Stream stream, Encoding encoding, bool isReader)
 
override void Flush ()
 
override int Read (byte[] buffer, int offset, int count)
 
override int ReadByte ()
 
override long Seek (long offset, SeekOrigin origin)
 
override void SetLength (long value)
 
override void Write (byte[] buffer, int offset, int count)
 
override void WriteByte (byte b)
 
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)
 
virtual Task CopyToAsync (Stream destination, int bufferSize, CancellationToken cancellationToken)
 
void Dispose ()
 
virtual void Close ()
 
virtual ValueTask DisposeAsync ()
 
Task FlushAsync ()
 
virtual Task FlushAsync (CancellationToken cancellationToken)
 
virtual IAsyncResult BeginRead (byte[] buffer, int offset, int count, AsyncCallback? callback, object? state)
 
virtual int EndRead (IAsyncResult asyncResult)
 
Task< int > ReadAsync (byte[] buffer, int offset, int count)
 
virtual Task< int > ReadAsync (byte[] buffer, int offset, int count, CancellationToken cancellationToken)
 
virtual ValueTask< int > ReadAsync (Memory< byte > buffer, CancellationToken cancellationToken=default(CancellationToken))
 
virtual IAsyncResult BeginWrite (byte[] buffer, int offset, int count, AsyncCallback? callback, object? state)
 
virtual void EndWrite (IAsyncResult asyncResult)
 
Task WriteAsync (byte[] buffer, int offset, int count)
 
virtual Task WriteAsync (byte[] buffer, int offset, int count, CancellationToken cancellationToken)
 
virtual ValueTask WriteAsync (ReadOnlyMemory< byte > buffer, CancellationToken cancellationToken=default(CancellationToken))
 
virtual int Read (Span< byte > buffer)
 
virtual void Write (ReadOnlySpan< byte > buffer)
 
object GetLifetimeService ()
 
virtual object InitializeLifetimeService ()
 

Static Public Member Functions

static ArraySegment< byte > ProcessBuffer (byte[] buffer, int offset, int count, Encoding encoding)
 
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

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

Private Types

enum  SupportedEncoding { UTF8 , UTF16LE , UTF16BE , None }
 

Private Member Functions

void CleanupCharBreak ()
 
void EnsureBuffers ()
 
void EnsureByteBuffer ()
 
void FillBuffer (int count)
 
void InitForReading (Stream inputStream, Encoding expectedEncoding)
 
void InitForWriting (Stream outputStream, Encoding writeEncoding)
 
SupportedEncoding ReadEncoding ()
 
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 Encoding GetEncoding (SupportedEncoding e)
 
static string GetEncodingName (SupportedEncoding enc)
 
static SupportedEncoding GetSupportedEncoding (Encoding encoding)
 
static SupportedEncoding ReadEncoding (byte b1, byte b2)
 
static void ThrowExpectedEncodingMismatch (SupportedEncoding expEnc, SupportedEncoding actualEnc)
 
static void RunReadWriteTaskWhenReady (Task asyncWaiter, ReadWriteTask readWriteTask)
 
static void RunReadWriteTask (ReadWriteTask readWriteTask)
 
static async Task FinishWriteAsync (Task writeTask, byte[] localBuffer)
 

Private Attributes

readonly byte[] _byteBuffer = new byte[1]
 
int _byteCount
 
int _byteOffset
 
byte[] _bytes
 
char[] _chars
 
Decoder _dec
 
Encoder _enc
 
Encoding _encoding
 
SupportedEncoding _encodingCode
 
readonly bool _isReading
 
Stream _stream
 

Static Private Attributes

static readonly UnicodeEncoding s_validatingBEUTF16 = new UnicodeEncoding(bigEndian: true, byteOrderMark: false, throwOnInvalidBytes: true)
 
static readonly UnicodeEncoding s_validatingUTF16 = new UnicodeEncoding(bigEndian: false, byteOrderMark: false, throwOnInvalidBytes: true)
 
static readonly UTF8Encoding s_validatingUTF8 = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true)
 
const int BufferLength = 128
 

Detailed Description

Definition at line 8 of file JsonEncodingStreamWrapper.cs.


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