程序包 com.ajaxjs.util
类 EncodeTools
java.lang.Object
com.ajaxjs.util.EncodeTools
String URL/Base64 encoder
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static byte[]
base64Decode
(String str) BASE64 解码static byte[]
base64Decoder
(byte[] bytes) BASE64 解码 这是核心解码方法,无关编码static String
BASE64 解码static String
base64DecodeToStringUtf8
(byte[] bytes) BASE64 解码static String
BASE64 解码static byte[]
base64Encode
(byte[] bytes) BASE64 编码 这是核心编码方法,无关编码static String
base64EncodeToString
(byte[] bytes) BASE64 编码static String
BASE64 编码static String
base64EncodeToStringUtf8
(byte[] bytes) BASE64 编码static String
BASE64 编码parseStringToMap
(String accessTokenStr) 字符串转 Map,格式为xxx=xxx&xxx=xxx
static String
urlChinese
(String str) URL 网址的中文乱码处理。static String
URL 解码static String
URL 编码static String
urlEncodeQuery
(String str) URL 编码。static String
urlEncodeSafe
(String value) URL 编码
-
字段详细资料
-
UTF8_SYMBOL
UTF-8 字符串而已- 另请参阅:
-
-
构造器详细资料
-
EncodeTools
public EncodeTools()
-
-
方法详细资料
-
urlChinese
URL 网址的中文乱码处理。 如果 Tomcat 过滤器设置了 UTF-8 那么这里就不用重复转码了- 参数:
str
- 通常是 URL 的 Query String 参数- 返回:
- 中文
-
urlEncodeQuery
URL 编码。 适合 GET 请求时候用- 参数:
str
- 输入的字符串- 返回:
- 编码后的字符串
-
urlEncode
URL 编码- 参数:
str
- 输入的字符串- 返回:
- URL 编码后的字符串
-
urlEncodeSafe
URL 编码- 参数:
value
- str- 返回:
- encode str
-
urlDecode
URL 解码- 参数:
str
- 输入的字符串- 返回:
- URL 解码后的字符串
-
parseStringToMap
字符串转 Map,格式为xxx=xxx&xxx=xxx
- 参数:
accessTokenStr
- 待转换的字符串- 返回:
- map
-
base64Encode
public static byte[] base64Encode(byte[] bytes) BASE64 编码 这是核心编码方法,无关编码- 参数:
bytes
- 待编码的字符串 bytes- 返回:
- 已编码的字符串 bytes
-
base64EncodeToString
BASE64 编码- 参数:
bytes
- 待编码的字符串 bytes- 返回:
- 已编码的字符串。使用 ISO-8859-1 字符集,请注意区别
-
base64EncodeToString
BASE64 编码- 参数:
str
- 待编码的字符串,使用 ISO-8859-1 字符集,请注意区别- 返回:
- 已编码的字符串。使用 ISO-8859-1 字符集,请注意区别
-
base64EncodeToStringUtf8
BASE64 编码- 参数:
bytes
- 待编码的字符串 bytes- 返回:
- 已编码的字符串。使用 UTF-8 字符集,请注意区别
-
base64EncodeToStringUtf8
BASE64 编码- 参数:
str
- 待编码的字符串,使用 UTF-8 字符集,请注意区别- 返回:
- 已编码的字符串。使用 UTF-8 字符集,请注意区别
-
base64Decoder
public static byte[] base64Decoder(byte[] bytes) BASE64 解码 这是核心解码方法,无关编码- 参数:
bytes
- 待解码的字符串 bytes- 返回:
- 已解码的字符串 bytes
-
base64Decode
BASE64 解码- 参数:
str
- 待解码的字符串 bytes,使用 ISO-8859-1 字符集,请注意区别- 返回:
- 已解码的字符串数据
-
base64DecodeToString
BASE64 解码- 参数:
str
- 待解码的字符串 bytes,使用 ISO-8859-1 字符集,请注意区别- 返回:
- 已解码的字符串数据
-
base64DecodeToStringUtf8
BASE64 解码- 参数:
bytes
- 待解码的字符串 bytes- 返回:
- 已解码的字符串。使用 UTF-8 字符集,请注意区别
-
base64DecodeToStringUtf8
BASE64 解码- 参数:
str
- 待解码的字符串,使用 UTF-8 字符集,请注意区别- 返回:
- 已解码的字符串。使用 UTF-8 字符集,请注意区别
-