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

◆ EncodeLiteralHeaderName()

static bool System.Net.Http.HPack.HPackEncoder.EncodeLiteralHeaderName ( string value,
Span< byte > destination,
out int bytesWritten )
inlinestaticprivate

Definition at line 78 of file HPackEncoder.cs.

79 {
80 if (destination.Length != 0)
81 {
82 destination[0] = 0;
83 if (IntegerEncoder.Encode(value.Length, 7, destination, out var bytesWritten2))
84 {
85 destination = destination.Slice(bytesWritten2);
86 if (value.Length <= destination.Length)
87 {
88 for (int i = 0; i < value.Length; i++)
89 {
90 char c = value[i];
91 destination[i] = (byte)(((uint)(c - 65) <= 25u) ? (c | 0x20u) : c);
92 }
93 bytesWritten = bytesWritten2 + value.Length;
94 return true;
95 }
96 }
97 }
98 bytesWritten = 0;
99 return false;
100 }

References System.destination, System.Net.Http.HPack.IntegerEncoder.Encode(), and System.value.

Referenced by System.Net.Http.HPack.HPackEncoder.EncodeLiteralHeaderFieldWithoutIndexingNewName(), and System.Net.Http.HPack.HPackEncoder.EncodeLiteralHeaderFieldWithoutIndexingNewName().