mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix comment
This commit is contained in:
@@ -14,17 +14,17 @@ import java.nio.charset.Charset;
|
||||
* Base64工具类,提供Base64的编码和解码方案<br>
|
||||
* base64编码是用64(2的6次方)个ASCII字符来表示256(2的8次方)个ASCII字符,<br>
|
||||
* 也就是三位二进制数组经过编码后变为四位的ASCII字符显示,长度比原来增加1/3。
|
||||
*
|
||||
* @author Looly
|
||||
*
|
||||
* @author Looly
|
||||
*/
|
||||
public class Base64 {
|
||||
|
||||
// -------------------------------------------------------------------- encode
|
||||
|
||||
/**
|
||||
* 编码为Base64,非URL安全的
|
||||
*
|
||||
* @param arr 被编码的数组
|
||||
*
|
||||
* @param arr 被编码的数组
|
||||
* @param lineSep 在76个char之后是CRLF还是EOF
|
||||
* @return 编码后的bytes
|
||||
*/
|
||||
@@ -34,8 +34,8 @@ public class Base64 {
|
||||
|
||||
/**
|
||||
* 编码为Base64,URL安全的
|
||||
*
|
||||
* @param arr 被编码的数组
|
||||
*
|
||||
* @param arr 被编码的数组
|
||||
* @param lineSep 在76个char之后是CRLF还是EOF
|
||||
* @return 编码后的bytes
|
||||
* @since 3.0.6
|
||||
@@ -46,7 +46,7 @@ public class Base64 {
|
||||
|
||||
/**
|
||||
* base64编码
|
||||
*
|
||||
*
|
||||
* @param source 被编码的base64字符串
|
||||
* @return 被加密后的字符串
|
||||
*/
|
||||
@@ -56,7 +56,7 @@ public class Base64 {
|
||||
|
||||
/**
|
||||
* base64编码,URL安全
|
||||
*
|
||||
*
|
||||
* @param source 被编码的base64字符串
|
||||
* @return 被加密后的字符串
|
||||
* @since 3.0.6
|
||||
@@ -67,8 +67,8 @@ public class Base64 {
|
||||
|
||||
/**
|
||||
* base64编码
|
||||
*
|
||||
* @param source 被编码的base64字符串
|
||||
*
|
||||
* @param source 被编码的base64字符串
|
||||
* @param charset 字符集
|
||||
* @return 被加密后的字符串
|
||||
*/
|
||||
@@ -79,7 +79,8 @@ public class Base64 {
|
||||
/**
|
||||
* base64编码,不进行padding(末尾不会填充'=')
|
||||
*
|
||||
* @param source 被编码的base64字符串
|
||||
* @param source 被编码的base64字符串
|
||||
* @param charset 编码
|
||||
* @return 被加密后的字符串
|
||||
* @since 5.5.2
|
||||
*/
|
||||
@@ -89,8 +90,8 @@ public class Base64 {
|
||||
|
||||
/**
|
||||
* base64编码,URL安全
|
||||
*
|
||||
* @param source 被编码的base64字符串
|
||||
*
|
||||
* @param source 被编码的base64字符串
|
||||
* @param charset 字符集
|
||||
* @return 被加密后的字符串
|
||||
* @since 3.0.6
|
||||
@@ -101,8 +102,8 @@ public class Base64 {
|
||||
|
||||
/**
|
||||
* base64编码
|
||||
*
|
||||
* @param source 被编码的base64字符串
|
||||
*
|
||||
* @param source 被编码的base64字符串
|
||||
* @param charset 字符集
|
||||
* @return 被加密后的字符串
|
||||
*/
|
||||
@@ -112,8 +113,8 @@ public class Base64 {
|
||||
|
||||
/**
|
||||
* base64编码,URL安全的
|
||||
*
|
||||
* @param source 被编码的base64字符串
|
||||
*
|
||||
* @param source 被编码的base64字符串
|
||||
* @param charset 字符集
|
||||
* @return 被加密后的字符串
|
||||
* @since 3.0.6
|
||||
@@ -124,7 +125,7 @@ public class Base64 {
|
||||
|
||||
/**
|
||||
* base64编码
|
||||
*
|
||||
*
|
||||
* @param source 被编码的base64字符串
|
||||
* @return 被加密后的字符串
|
||||
*/
|
||||
@@ -145,7 +146,7 @@ public class Base64 {
|
||||
|
||||
/**
|
||||
* base64编码,URL安全的
|
||||
*
|
||||
*
|
||||
* @param source 被编码的base64字符串
|
||||
* @return 被加密后的字符串
|
||||
* @since 3.0.6
|
||||
@@ -156,7 +157,7 @@ public class Base64 {
|
||||
|
||||
/**
|
||||
* base64编码
|
||||
*
|
||||
*
|
||||
* @param in 被编码base64的流(一般为图片流或者文件流)
|
||||
* @return 被加密后的字符串
|
||||
* @since 4.0.9
|
||||
@@ -167,7 +168,7 @@ public class Base64 {
|
||||
|
||||
/**
|
||||
* base64编码,URL安全的
|
||||
*
|
||||
*
|
||||
* @param in 被编码base64的流(一般为图片流或者文件流)
|
||||
* @return 被加密后的字符串
|
||||
* @since 4.0.9
|
||||
@@ -178,7 +179,7 @@ public class Base64 {
|
||||
|
||||
/**
|
||||
* base64编码
|
||||
*
|
||||
*
|
||||
* @param file 被编码base64的文件
|
||||
* @return 被加密后的字符串
|
||||
* @since 4.0.9
|
||||
@@ -189,7 +190,7 @@ public class Base64 {
|
||||
|
||||
/**
|
||||
* base64编码,URL安全的
|
||||
*
|
||||
*
|
||||
* @param file 被编码base64的文件
|
||||
* @return 被加密后的字符串
|
||||
* @since 4.0.9
|
||||
@@ -200,11 +201,11 @@ public class Base64 {
|
||||
|
||||
/**
|
||||
* 编码为Base64<br>
|
||||
* 如果isMultiLine为<code>true</code>,则每76个字符一个换行符,否则在一行显示
|
||||
*
|
||||
* @param arr 被编码的数组
|
||||
* 如果isMultiLine为{@code true},则每76个字符一个换行符,否则在一行显示
|
||||
*
|
||||
* @param arr 被编码的数组
|
||||
* @param isMultiLine 在76个char之后是CRLF还是EOF
|
||||
* @param isUrlSafe 是否使用URL安全字符,一般为<code>false</code>
|
||||
* @param isUrlSafe 是否使用URL安全字符,一般为{@code false}
|
||||
* @return 编码后的bytes
|
||||
*/
|
||||
public static byte[] encode(byte[] arr, boolean isMultiLine, boolean isUrlSafe) {
|
||||
@@ -212,9 +213,10 @@ public class Base64 {
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------- decode
|
||||
|
||||
/**
|
||||
* base64解码
|
||||
*
|
||||
*
|
||||
* @param source 被解码的base64字符串
|
||||
* @return 被加密后的字符串
|
||||
* @since 4.3.2
|
||||
@@ -225,7 +227,7 @@ public class Base64 {
|
||||
|
||||
/**
|
||||
* base64解码
|
||||
*
|
||||
*
|
||||
* @param source 被解码的base64字符串
|
||||
* @return 被加密后的字符串
|
||||
*/
|
||||
@@ -235,8 +237,8 @@ public class Base64 {
|
||||
|
||||
/**
|
||||
* base64解码
|
||||
*
|
||||
* @param source 被解码的base64字符串
|
||||
*
|
||||
* @param source 被解码的base64字符串
|
||||
* @param charset 字符集
|
||||
* @return 被加密后的字符串
|
||||
*/
|
||||
@@ -246,8 +248,8 @@ public class Base64 {
|
||||
|
||||
/**
|
||||
* base64解码
|
||||
*
|
||||
* @param source 被解码的base64字符串
|
||||
*
|
||||
* @param source 被解码的base64字符串
|
||||
* @param charset 字符集
|
||||
* @return 被加密后的字符串
|
||||
*/
|
||||
@@ -257,8 +259,8 @@ public class Base64 {
|
||||
|
||||
/**
|
||||
* base64解码
|
||||
*
|
||||
* @param base64 被解码的base64字符串
|
||||
*
|
||||
* @param base64 被解码的base64字符串
|
||||
* @param destFile 目标文件
|
||||
* @return 目标文件
|
||||
* @since 4.0.9
|
||||
@@ -269,9 +271,9 @@ public class Base64 {
|
||||
|
||||
/**
|
||||
* base64解码
|
||||
*
|
||||
* @param base64 被解码的base64字符串
|
||||
* @param out 写出到的流
|
||||
*
|
||||
* @param base64 被解码的base64字符串
|
||||
* @param out 写出到的流
|
||||
* @param isCloseOut 是否关闭输出流
|
||||
* @since 4.0.9
|
||||
*/
|
||||
@@ -281,7 +283,7 @@ public class Base64 {
|
||||
|
||||
/**
|
||||
* base64解码
|
||||
*
|
||||
*
|
||||
* @param base64 被解码的base64字符串
|
||||
* @return 被加密后的字符串
|
||||
*/
|
||||
@@ -291,11 +293,11 @@ public class Base64 {
|
||||
|
||||
/**
|
||||
* base64解码
|
||||
*
|
||||
* @param source 被解码的base64字符串
|
||||
*
|
||||
* @param source 被解码的base64字符串
|
||||
* @param charset 字符集
|
||||
* @return 被加密后的字符串
|
||||
*@deprecated 编码参数无意义,作废
|
||||
* @deprecated 编码参数无意义,作废
|
||||
*/
|
||||
@Deprecated
|
||||
public static byte[] decode(CharSequence source, String charset) {
|
||||
@@ -304,11 +306,11 @@ public class Base64 {
|
||||
|
||||
/**
|
||||
* base64解码
|
||||
*
|
||||
* @param source 被解码的base64字符串
|
||||
*
|
||||
* @param source 被解码的base64字符串
|
||||
* @param charset 字符集
|
||||
* @return 被加密后的字符串
|
||||
*@deprecated 编码参数无意义,作废
|
||||
* @deprecated 编码参数无意义,作废
|
||||
*/
|
||||
@Deprecated
|
||||
public static byte[] decode(CharSequence source, Charset charset) {
|
||||
@@ -317,7 +319,7 @@ public class Base64 {
|
||||
|
||||
/**
|
||||
* 解码Base64
|
||||
*
|
||||
*
|
||||
* @param in 输入
|
||||
* @return 解码后的bytes
|
||||
*/
|
||||
|
@@ -563,6 +563,7 @@ public class ZipUtil {
|
||||
* 获取压缩包中的指定文件流
|
||||
*
|
||||
* @param zipFile 压缩文件
|
||||
* @param charset 编码
|
||||
* @param path 需要提取文件的文件名或路径
|
||||
* @return 压缩文件流,如果未找到返回{@code null}
|
||||
* @since 5.5.2
|
||||
|
Reference in New Issue
Block a user