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

◆ GetTransferCodingLength()

static int System.Net.Http.Headers.TransferCodingHeaderValue.GetTransferCodingLength ( string input,
int startIndex,
Func< TransferCodingHeaderValue > transferCodingCreator,
out TransferCodingHeaderValue parsedValue )
inlinestaticpackageinherited

Definition at line 51 of file TransferCodingHeaderValue.cs.

52 {
53 parsedValue = null;
54 if (string.IsNullOrEmpty(input) || startIndex >= input.Length)
55 {
56 return 0;
57 }
58 int tokenLength = HttpRuleParser.GetTokenLength(input, startIndex);
59 if (tokenLength == 0)
60 {
61 return 0;
62 }
63 string value = input.Substring(startIndex, tokenLength);
64 int num = startIndex + tokenLength;
65 num += HttpRuleParser.GetWhitespaceLength(input, num);
67 if (num < input.Length && input[num] == ';')
68 {
70 transferCodingHeaderValue._value = value;
71 num++;
72 int nameValueListLength = NameValueHeaderValue.GetNameValueListLength(input, num, ';', (ObjectCollection<NameValueHeaderValue>)transferCodingHeaderValue.Parameters);
73 if (nameValueListLength == 0)
74 {
75 return 0;
76 }
78 return num + nameValueListLength - startIndex;
79 }
81 transferCodingHeaderValue._value = value;
83 return num - startIndex;
84 }

References System.Net.Http.Headers.NameValueHeaderValue.GetNameValueListLength(), System.Net.Http.HttpRuleParser.GetTokenLength(), System.Net.Http.HttpRuleParser.GetWhitespaceLength(), System.input, System.startIndex, and System.value.

Referenced by System.Net.Http.Headers.TransferCodingHeaderParser.GetParsedValueLength().