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

◆ Encode() [1/2]

static void System.Xml.BinHexEncoder.Encode ( byte[] buffer,
int index,
int count,
XmlWriter writer )
inlinestaticpackage

Definition at line 7 of file BinHexEncoder.cs.

8 {
9 if (buffer == null)
10 {
11 throw new ArgumentNullException("buffer");
12 }
13 if (index < 0)
14 {
15 throw new ArgumentOutOfRangeException("index");
16 }
17 if (count < 0)
18 {
19 throw new ArgumentOutOfRangeException("count");
20 }
21 if (count > buffer.Length - index)
22 {
23 throw new ArgumentOutOfRangeException("count");
24 }
25 char[] array = new char[(count * 2 < 128) ? (count * 2) : 128];
26 int num = index + count;
27 while (index < num)
28 {
29 int num2 = ((count < 64) ? count : 64);
31 writer.WriteRaw(array, 0, num2 * 2);
32 index += num2;
33 count -= num2;
34 }
35 }
static void EncodeToUtf16(ReadOnlySpan< byte > bytes, Span< char > chars, Casing casing=Casing.Upper)

References System.array, System.buffer, System.count, System.Xml.Dictionary, System.HexConverter.EncodeToUtf16(), System.index, and System.writer.

Referenced by System.Xml.XmlConvert.ToBinHexString(), System.Xml.XmlSqlBinaryReader.ValueAsString(), and System.Xml.XmlWriter.WriteBinHex().