public static string UrlEncode(string str)
 {
     if (str == null)
     {
         return(null);
     }
     return(XmlaHttpUtility.UrlEncode(str, Encoding.UTF8));
 }
 public static byte[] UrlEncodeToBytes(string str, Encoding e)
 {
     if (str == null)
     {
         return(null);
     }
     byte[] bytes = e.GetBytes(str);
     return(XmlaHttpUtility.UrlEncode(bytes, 0, bytes.Length, false));
 }
 private static byte[] UrlEncode(byte[] bytes, int offset, int count, bool alwaysCreateNewReturnValue)
 {
     byte[] array = XmlaHttpUtility.UrlEncode(bytes, offset, count);
     if (!alwaysCreateNewReturnValue || array == null || array != bytes)
     {
         return(array);
     }
     return((byte[])array.Clone());
 }
 public static byte[] UrlEncodeToBytes(byte[] bytes, int offset, int count)
 {
     return(XmlaHttpUtility.UrlEncode(bytes, offset, count, true));
 }