示例#1
0
 public static byte[] Decode(byte[] input, byte escapeChar, byte[] space)
 {
     byte[] result;
     using (MemoryStream memoryStream = new MemoryStream(input.Length))
     {
         for (int i = 0; i < input.Length; i++)
         {
             bool flag = WWWTranscoder.ByteSubArrayEquals(input, i, space);
             if (flag)
             {
                 i += space.Length - 1;
                 memoryStream.WriteByte(32);
             }
             else
             {
                 bool flag2 = input[i] == escapeChar && i + 2 < input.Length;
                 if (flag2)
                 {
                     i++;
                     memoryStream.WriteByte(WWWTranscoder.Hex2Byte(input, i++));
                 }
                 else
                 {
                     memoryStream.WriteByte(input[i]);
                 }
             }
         }
         result = memoryStream.ToArray();
     }
     return(result);
 }