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

◆ TryEnsureBytes()

bool System.Xml.XmlBufferReader.TryEnsureBytes ( int count)
inlineprivate

Definition at line 227 of file XmlBufferReader.cs.

228 {
229 if (_stream == null)
230 {
231 return false;
232 }
233 while (true)
234 {
235 int num = _offset + count;
236 if (num <= _offsetMax)
237 {
238 break;
239 }
240 if (num > _buffer.Length)
241 {
242 byte[] array = new byte[Math.Max(256, _buffer.Length * 2)];
244 num = Math.Min(num, array.Length);
245 _buffer = array;
247 }
248 int num2 = num - _offsetMax;
249 do
250 {
252 if (num3 == 0)
253 {
254 return false;
255 }
256 _offsetMax += num3;
257 num2 -= num3;
258 }
259 while (num2 > 0);
260 }
261 return true;
262 }
static void BlockCopy(Array src, int srcOffset, Array dst, int dstOffset, int count)
Definition Buffer.cs:102
int Read(byte[] buffer, int offset, int count)

References System.Xml.XmlBufferReader._buffer, System.Xml.XmlBufferReader._offset, System.Xml.XmlBufferReader._offsetMax, System.Xml.XmlBufferReader._stream, System.Xml.XmlBufferReader._streamBuffer, System.array, System.Buffer.BlockCopy(), System.count, System.Xml.Dictionary, System.Math.Max(), System.Math.Min(), and System.IO.Stream.Read().

Referenced by System.Xml.XmlBufferReader.EnsureBytes(), System.Xml.XmlBufferReader.GetBuffer(), and System.Xml.XmlBufferReader.TryEnsureByte().