Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ InitStreamInput() [4/5]

void System.Xml.XmlTextReaderImpl.InitStreamInput ( Uri baseUri,
string baseUriStr,
Stream stream,
byte[] bytes,
int byteCount,
Encoding encoding )
inlineprivate

Definition at line 3089 of file XmlTextReaderImpl.cs.

3090 {
3092 _ps.baseUri = baseUri;
3093 _ps.baseUriStr = baseUriStr;
3094 int num;
3095 if (bytes != null)
3096 {
3097 _ps.bytes = bytes;
3099 num = _ps.bytes.Length;
3100 }
3101 else
3102 {
3103 num = ((_laterInitParam == null || !_laterInitParam.useAsync) ? XmlReader.CalcBufferSize(stream) : 65536);
3104 if (_ps.bytes == null || _ps.bytes.Length < num)
3105 {
3106 _ps.bytes = new byte[num];
3107 }
3108 }
3109 if (_ps.chars == null || _ps.chars.Length < num + 1)
3110 {
3111 _ps.chars = new char[num + 1];
3112 }
3113 _ps.bytePos = 0;
3114 while (_ps.bytesUsed < 4 && _ps.bytes.Length - _ps.bytesUsed > 0)
3115 {
3116 int num2 = stream.Read(_ps.bytes, _ps.bytesUsed, _ps.bytes.Length - _ps.bytesUsed);
3117 if (num2 == 0)
3118 {
3119 _ps.isStreamEof = true;
3120 break;
3121 }
3123 }
3124 if (encoding == null)
3125 {
3126 encoding = DetectEncoding();
3127 }
3128 SetupEncoding(encoding);
3129 EatPreamble();
3132 _ps.appendMode = true;
3133 ReadData();
3134 }
void SetupEncoding(Encoding encoding)

References System.Xml.XmlTextReaderImpl._documentStartBytePos, System.Xml.XmlTextReaderImpl._laterInitParam, System.Xml.XmlTextReaderImpl._normalize, System.Xml.XmlTextReaderImpl._ps, System.byteCount, System.Xml.XmlTextReaderImpl.ParsingState.bytePos, System.bytes, System.Xml.XmlTextReaderImpl.ParsingState.bytes, System.Xml.XmlTextReaderImpl.ParsingState.bytesUsed, System.Xml.XmlReader.CalcBufferSize(), System.Xml.XmlTextReaderImpl.ParsingState.chars, System.Xml.XmlTextReaderImpl.DetectEncoding(), System.Xml.Dictionary, System.Xml.XmlTextReaderImpl.EatPreamble(), System.Xml.XmlTextReaderImpl.ReadData(), System.Xml.XmlTextReaderImpl.SetupEncoding(), System.stream, and System.Xml.XmlTextReaderImpl.LaterInitParam.useAsync.