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

◆ TryParseValue()

override bool System.Net.Http.Headers.ByteArrayHeaderParser.TryParseValue ( [NotNullWhen(true)] string value,
object storeValue,
ref int index,
[NotNullWhen(true)] out object parsedValue )
inline

Definition at line 19 of file ByteArrayHeaderParser.cs.

20 {
21 parsedValue = null;
22 if (string.IsNullOrEmpty(value) || index == value.Length)
23 {
24 return false;
25 }
26 string text = value;
27 if (index > 0)
28 {
29 text = value.Substring(index);
30 }
31 try
32 {
33 parsedValue = Convert.FromBase64String(text);
34 index = value.Length;
35 return true;
36 }
37 catch (FormatException ex)
38 {
39 if (System.Net.NetEventSource.Log.IsEnabled())
40 {
42 }
43 }
44 return false;
45 }
static readonly System.Net.NetEventSource Log
static void Error(object thisOrContextObject, FormattableString formattableString, [CallerMemberName] string memberName=null)
static string net_http_parser_invalid_base64_string
Definition SR.cs:66
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
Definition SR.cs:7

References System.Net.NetEventSource.Error(), System.SR.Format(), System.Convert.FromBase64String(), System.index, System.Net.NetEventSource.Log, System.Exception.Message, System.SR.net_http_parser_invalid_base64_string, System.text, and System.value.