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

◆ GetFullChars()

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

Definition at line 7 of file Ucs4Decoder4321.cs.

8 {
10 int i = byteIndex;
11 int num = charIndex;
12 for (; i + 3 < byteCount; i += 4)
13 {
15 if (num2 > 1114111)
16 {
17 throw new ArgumentException(System.SR.Format(System.SR.Enc_InvalidByteInEncoding, new object[1] { i }), (string?)null);
18 }
19 if (num2 > 65535)
20 {
21 Ucs4ToUTF16(num2, chars, num);
22 num++;
23 }
24 else
25 {
26 if (XmlCharType.IsSurrogate((int)num2))
27 {
28 throw new XmlException(System.SR.Xml_InvalidCharInThisEncoding, string.Empty);
29 }
30 chars[num] = (char)num2;
31 }
32 num++;
33 }
34 return num - charIndex;
35 }
static uint ReadUInt32LittleEndian(ReadOnlySpan< byte > source)
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.Buffers.Binary.BinaryPrimitives.ReadUInt32LittleEndian(), System.Xml.Ucs4Decoder.Ucs4ToUTF16(), System.SR.Xml_InvalidCharInThisEncoding, and System.Xml.XmlException.