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

◆ GetString()

static unsafe string System.Net.WebHeaderEncoding.GetString ( byte[] bytes,
int byteIndex,
int byteCount )
inlinestaticpackage

Definition at line 5 of file WebHeaderEncoding.cs.

6 {
7 if (byteCount < 1)
8 {
9 return string.Empty;
10 }
11 return string.Create(byteCount, (bytes, byteIndex), delegate(Span<char> buffer, (byte[] bytes, int byteIndex) state)
12 {
13 fixed (byte* ptr = &state.bytes[state.byteIndex])
14 {
15 fixed (char* ptr3 = buffer)
16 {
17 byte* ptr2 = ptr;
18 char* ptr4 = ptr3;
19 int num;
20 for (num = buffer.Length; num >= 8; num -= 8)
21 {
22 *ptr4 = (char)(*ptr2);
23 ptr4[1] = (char)ptr2[1];
24 ptr4[2] = (char)ptr2[2];
25 ptr4[3] = (char)ptr2[3];
26 ptr4[4] = (char)ptr2[4];
27 ptr4[5] = (char)ptr2[5];
28 ptr4[6] = (char)ptr2[6];
29 ptr4[7] = (char)ptr2[7];
30 ptr4 += 8;
31 ptr2 += 8;
32 }
33 for (int i = 0; i < num; i++)
34 {
35 ptr4[i] = (char)ptr2[i];
36 }
37 }
38 }
39 });
40 }

References System.buffer, System.byteCount, System.byteIndex, System.bytes, and System.state.

Referenced by System.Net.HttpListener.HandleAuthentication().