UnityEngine.WWWTranscoder.Decode C# (CSharp) Method

Decode() public static method

public static Decode ( byte input, byte escapeChar, byte space ) : byte[]
input byte
escapeChar byte
space byte
return byte[]
        public static byte[] Decode(byte[] input, byte escapeChar, byte space)
        {
            using (MemoryStream stream = new MemoryStream(input.Length))
            {
                for (int i = 0; i < input.Length; i++)
                {
                    if (input[i] == space)
                    {
                        stream.WriteByte(0x20);
                    }
                    else if ((input[i] == escapeChar) && ((i + 2) < input.Length))
                    {
                        i++;
                        stream.WriteByte(Hex2Byte(input, i++));
                    }
                    else
                    {
                        stream.WriteByte(input[i]);
                    }
                }
                return stream.ToArray();
            }
        }

Usage Example

コード例 #1
0
 public static byte[] QPDecode(byte[] toEncode)
 {
     return(WWWTranscoder.Decode(toEncode, WWWTranscoder.qpEscapeChar, WWWTranscoder.qpSpace));
 }
All Usage Examples Of UnityEngine.WWWTranscoder::Decode