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

◆ CreateSqlReader()

static XmlReader System.Xml.XmlReader.CreateSqlReader ( Stream input,
XmlReaderSettings settings,
XmlParserContext inputContext )
inlinestaticpackageinherited

Definition at line 1434 of file XmlReader.cs.

1435 {
1436 if (input == null)
1437 {
1438 throw new ArgumentNullException("input");
1439 }
1440 if (settings == null)
1441 {
1442 settings = XmlReaderSettings.s_defaultReaderSettings;
1443 }
1444 byte[] array = new byte[CalcBufferSize(input)];
1445 int num = 0;
1446 int num2;
1447 do
1448 {
1449 num2 = input.Read(array, num, array.Length - num);
1450 num += num2;
1451 }
1452 while (num2 > 0 && num < 2);
1453 XmlReader xmlReader;
1454 if (num >= 2 && array[0] == 223 && array[1] == byte.MaxValue)
1455 {
1456 if (inputContext != null)
1457 {
1458 throw new ArgumentException(System.SR.XmlBinary_NoParserContext, "inputContext");
1459 }
1460 xmlReader = new XmlSqlBinaryReader(input, array, num, string.Empty, settings.CloseInput, settings);
1461 }
1462 else
1463 {
1464 xmlReader = new XmlTextReaderImpl(input, array, num, settings, null, string.Empty, inputContext, settings.CloseInput);
1465 }
1466 if (settings.ValidationType != 0)
1467 {
1468 xmlReader = settings.AddValidation(xmlReader);
1469 }
1470 if (settings.Async)
1471 {
1472 xmlReader = XmlAsyncCheckReader.CreateAsyncCheckWrapper(xmlReader);
1473 }
1474 return xmlReader;
1475 }
static string XmlBinary_NoParserContext
Definition SR.cs:1378
Definition SR.cs:7
static int CalcBufferSize(Stream input)

References System.Xml.XmlReaderSettings.AddValidation(), System.Xml.ArgumentException, System.array, System.Xml.XmlReaderSettings.Async, System.Xml.XmlReader.CalcBufferSize(), System.Xml.XmlReaderSettings.CloseInput, System.Xml.XmlAsyncCheckReader.CreateAsyncCheckWrapper(), System.Xml.Dictionary, System.input, System.Xml.XmlReaderSettings.s_defaultReaderSettings, System.Xml.XmlReaderSettings.ValidationType, and System.SR.XmlBinary_NoParserContext.