diff --git a/websocket-sharp/Net/HttpUtility.cs b/websocket-sharp/Net/HttpUtility.cs index c05482f1..f427da7b 100644 --- a/websocket-sharp/Net/HttpUtility.cs +++ b/websocket-sharp/Net/HttpUtility.cs @@ -911,6 +911,19 @@ namespace WebSocketSharp.Net return UrlDecode (s, Encoding.UTF8); } + public static string UrlDecode (byte[] bytes, Encoding encoding) + { + if (bytes == null) + throw new ArgumentNullException ("bytes"); + + var len = bytes.Length; + return len > 0 + ? (encoding ?? Encoding.UTF8).GetString ( + urlDecodeToBytes (bytes, 0, len) + ) + : String.Empty; + } + public static string UrlDecode (string s, Encoding encoding) { if (s == null) @@ -925,19 +938,6 @@ namespace WebSocketSharp.Net ); } - public static string UrlDecode (byte[] bytes, Encoding encoding) - { - if (bytes == null) - throw new ArgumentNullException ("bytes"); - - var len = bytes.Length; - return len > 0 - ? (encoding ?? Encoding.UTF8).GetString ( - urlDecodeToBytes (bytes, 0, len) - ) - : String.Empty; - } - public static string UrlDecode ( byte[] bytes, int offset, int count, Encoding encoding )