Package me.zhyd.oauth.utils
Class Base64Utils
java.lang.Object
me.zhyd.oauth.utils.Base64Utils
Base64编码
- Since:
- 3.2.0
- Author:
- looly
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Stringencode(byte[] source) base64编码static byte[]encode(byte[] arr, boolean lineSep) 编码为Base64,非URL安全的static byte[]encode(byte[] arr, boolean isMultiLine, boolean isUrlSafe) 编码为Base64
如果isMultiLine为true,则每76个字符一个换行符,否则在一行显示static Stringencode(CharSequence source) base64编码static Stringencode(CharSequence source, Charset charset) base64编码static StringencodeUrlSafe(byte[] source) base64编码,URL安全的static byte[]encodeUrlSafe(byte[] arr, boolean lineSep) 编码为Base64,URL安全的static StringencodeUrlSafe(CharSequence source) base64编码,URL安全static StringencodeUrlSafe(CharSequence source, Charset charset) base64编码,URL安全的
-
Constructor Details
-
Base64Utils
public Base64Utils()
-
-
Method Details
-
encode
public static byte[] encode(byte[] arr, boolean lineSep) 编码为Base64,非URL安全的- Parameters:
arr- 被编码的数组lineSep- 在76个char之后是CRLF还是EOF- Returns:
- 编码后的bytes
-
encodeUrlSafe
public static byte[] encodeUrlSafe(byte[] arr, boolean lineSep) 编码为Base64,URL安全的- Parameters:
arr- 被编码的数组lineSep- 在76个char之后是CRLF还是EOF- Returns:
- 编码后的bytes
- Since:
- 3.0.6
-
encode
base64编码- Parameters:
source- 被编码的base64字符串- Returns:
- 被加密后的字符串
-
encodeUrlSafe
base64编码,URL安全- Parameters:
source- 被编码的base64字符串- Returns:
- 被加密后的字符串
- Since:
- 3.0.6
-
encode
base64编码- Parameters:
source- 被编码的base64字符串charset- 字符集- Returns:
- 被加密后的字符串
-
encodeUrlSafe
base64编码,URL安全的- Parameters:
source- 被编码的base64字符串charset- 字符集- Returns:
- 被加密后的字符串
- Since:
- 3.0.6
-
encode
base64编码- Parameters:
source- 被编码的base64字符串- Returns:
- 被加密后的字符串
-
encodeUrlSafe
base64编码,URL安全的- Parameters:
source- 被编码的base64字符串- Returns:
- 被加密后的字符串
- Since:
- 3.0.6
-
encode
public static byte[] encode(byte[] arr, boolean isMultiLine, boolean isUrlSafe) 编码为Base64
如果isMultiLine为true,则每76个字符一个换行符,否则在一行显示- Parameters:
arr- 被编码的数组isMultiLine- 在76个char之后是CRLF还是EOFisUrlSafe- 是否使用URL安全字符,一般为false- Returns:
- 编码后的bytes
-