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

◆ UrlEncodeToBytes()

static ? byte[] System.Net.WebUtility.UrlEncodeToBytes ( byte?[] value,
int offset,
int count )
inlinestatic

Definition at line 716 of file WebUtility.cs.

717 {
719 {
720 return null;
721 }
722 bool flag = false;
723 int num = 0;
724 for (int i = 0; i < count; i++)
725 {
726 char c = (char)value[offset + i];
727 if (c == ' ')
728 {
729 flag = true;
730 }
731 else if (!IsUrlSafeChar(c))
732 {
733 num++;
734 }
735 }
736 if (!flag && num == 0)
737 {
738 byte[] array = new byte[count];
739 Buffer.BlockCopy(value, offset, array, 0, count);
740 return array;
741 }
742 byte[] array2 = new byte[count + num * 2];
744 return array2;
745 }
static void GetEncodedBytes(byte[] originalBytes, int offset, int count, byte[] expandedBytes)
static bool ValidateUrlEncodingParameters(byte[] bytes, int offset, int count)
static bool IsUrlSafeChar(char ch)

References System.array, System.Buffer.BlockCopy(), System.count, System.Net.WebUtility.GetEncodedBytes(), System.Net.WebUtility.IsUrlSafeChar(), System.offset, System.Net.WebUtility.ValidateUrlEncodingParameters(), and System.value.