Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
System.Xml.EncodingStreamWrapper Class Referencesealed

Public Member Functions

 EncodingStreamWrapper (Stream stream, Encoding encoding)
 
 EncodingStreamWrapper (Stream stream, Encoding encoding, bool emitBOM)
 
override void Flush ()
 
override int ReadByte ()
 
override int Read (byte[] buffer, int offset, int count)
 
override long Seek (long offset, SeekOrigin origin)
 
override void WriteByte (byte b)
 
override void Write (byte[] buffer, int offset, int count)
 
override void SetLength (long value)
 
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 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)
 

Static Package Functions

static ArraySegment< byte > ProcessBuffer (byte[] buffer, int offset, int count, Encoding encoding)
 

Properties

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

Private Types

enum  SupportedEncoding { UTF8 , UTF16LE , UTF16BE , None }
 

Private Member Functions

void SetReadDocumentEncoding (SupportedEncoding e)
 
SupportedEncoding ReadBOMEncoding (bool notOutOfBand)
 
void FillBuffer (int count)
 
void EnsureBuffers ()
 
void EnsureByteBuffer ()
 
void CleanupCharBreak ()
 
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 Encoding GetSafeEncoding (SupportedEncoding e)
 
static string GetEncodingName (SupportedEncoding enc)
 
static SupportedEncoding GetSupportedEncoding (Encoding encoding)
 
static SupportedEncoding ReadBOMEncoding (byte b1, byte b2, byte b3, byte b4, bool notOutOfBand, out int preserve)
 
static void CheckUTF8DeclarationEncoding (byte[] buffer, int offset, int count, SupportedEncoding e, SupportedEncoding expectedEnc)
 
static bool CompareCaseInsensitive (byte[] key, byte[] buffer, int offset)
 
static bool Compare (byte[] key, byte[] buffer, int offset)
 
static bool IsWhitespace (byte ch)
 
static void ThrowExpectedEncodingMismatch (SupportedEncoding expEnc, SupportedEncoding actualEnc)
 
static void ThrowEncodingMismatch (string declEnc, SupportedEncoding enc)
 
static void ThrowEncodingMismatch (string declEnc, string docEnc)
 
static void RunReadWriteTaskWhenReady (Task asyncWaiter, ReadWriteTask readWriteTask)
 
static void RunReadWriteTask (ReadWriteTask readWriteTask)
 
static async Task FinishWriteAsync (Task writeTask, byte[] localBuffer)
 

Private Attributes

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

Static Private Attributes

static readonly UTF8Encoding s_safeUTF8 = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: false)
 
static readonly UnicodeEncoding s_safeUTF16 = new UnicodeEncoding(bigEndian: false, byteOrderMark: false, throwOnInvalidBytes: false)
 
static readonly UnicodeEncoding s_safeBEUTF16 = new UnicodeEncoding(bigEndian: true, byteOrderMark: false, throwOnInvalidBytes: false)
 
static readonly UTF8Encoding s_validatingUTF8 = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true)
 
static readonly UnicodeEncoding s_validatingUTF16 = new UnicodeEncoding(bigEndian: false, byteOrderMark: false, throwOnInvalidBytes: true)
 
static readonly UnicodeEncoding s_validatingBEUTF16 = new UnicodeEncoding(bigEndian: true, byteOrderMark: false, throwOnInvalidBytes: true)
 
const int BufferLength = 128
 
static readonly byte[] s_encodingAttr = new byte[8] { 101, 110, 99, 111, 100, 105, 110, 103 }
 
static readonly byte[] s_encodingUTF8 = new byte[5] { 117, 116, 102, 45, 56 }
 
static readonly byte[] s_encodingUnicode = new byte[6] { 117, 116, 102, 45, 49, 54 }
 
static readonly byte[] s_encodingUnicodeLE = new byte[8] { 117, 116, 102, 45, 49, 54, 108, 101 }
 
static readonly byte[] s_encodingUnicodeBE = new byte[8] { 117, 116, 102, 45, 49, 54, 98, 101 }
 

Detailed Description

Definition at line 7 of file EncodingStreamWrapper.cs.


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