Example #1
0
 /** URL 编码, Encode默认为UTF-8. */
 public static String urlEncode(String part) {
   try {
     return URLEncoder.encode(part, DEFAULT_URL_ENCODING);
   } catch (UnsupportedEncodingException e) {
     throw ExceptionTools.unchecked(e);
   }
 }
Example #2
0
 /** Hex解码. */
 public static byte[] decodeHex(String input) {
   try {
     return Hex.decodeHex(input.toCharArray());
   } catch (DecoderException e) {
     throw ExceptionTools.unchecked(e);
   }
 }