Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
Ucs4Decoder1234.cs
Go to the documentation of this file.
2
3namespace System.Xml;
4
5internal sealed class Ucs4Decoder1234 : Ucs4Decoder
6{
7 internal override int GetFullChars(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex)
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 {
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 }
36}
static uint ReadUInt32BigEndian(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
override int GetFullChars(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex)
void Ucs4ToUTF16(uint code, char[] chars, int charIndex)
static bool IsSurrogate(int ch)