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

◆ GetFullChars()

override int System.Xml.Ucs4Decoder2143.GetFullChars ( byte[] bytes,
int byteIndex,
int byteCount,
char[] chars,
int charIndex )
inlinepackage

Definition at line 5 of file Ucs4Decoder2143.cs.

6 {
8 int i = byteIndex;
9 int num = charIndex;
10 for (; i + 3 < byteCount; i += 4)
11 {
12 uint num2 = (uint)((bytes[i + 1] << 24) | (bytes[i] << 16) | (bytes[i + 3] << 8) | bytes[i + 2]);
13 if (num2 > 1114111)
14 {
15 throw new ArgumentException(System.SR.Format(System.SR.Enc_InvalidByteInEncoding, new object[1] { i }), (string?)null);
16 }
17 if (num2 > 65535)
18 {
19 Ucs4ToUTF16(num2, chars, num);
20 num++;
21 }
22 else
23 {
24 if (XmlCharType.IsSurrogate((int)num2))
25 {
26 throw new XmlException(System.SR.Xml_InvalidCharInThisEncoding, string.Empty);
27 }
28 chars[num] = (char)num2;
29 }
30 num++;
31 }
32 return num - charIndex;
33 }
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string Xml_InvalidCharInThisEncoding
Definition SR.cs:56
static string Enc_InvalidByteInEncoding
Definition SR.cs:1818
Definition SR.cs:7
void Ucs4ToUTF16(uint code, char[] chars, int charIndex)

References System.Xml.ArgumentException, System.byteCount, System.byteIndex, System.bytes, System.charIndex, System.chars, System.Xml.Dictionary, System.SR.Enc_InvalidByteInEncoding, System.SR.Format(), System.Xml.XmlCharType.IsSurrogate(), System.Xml.Ucs4Decoder.Ucs4ToUTF16(), System.SR.Xml_InvalidCharInThisEncoding, and System.Xml.XmlException.