类 Base64Utils
java.lang.Object
com.walker.infrastructure.utils.Base64Utils
BASE64编码解码工具包
依赖javabase64-1.3.1.jar
- 版本:
- 1.0
- 作者:
- IceWee
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static voidbyteArrayToFile(byte[] bytes, String filePath) 二进制数据写文件static byte[]BASE64字符串解码为二进制数据static voiddecodeToFile(String filePath, String base64) BASE64字符串转回文件static Stringencode(byte[] bytes) 二进制数据编码为BASE64字符串static StringencodeFile(String filePath) 将文件编码为BASE64字符串static byte[]fileToByte(String filePath) 文件转换为二进制数组
-
构造器详细资料
-
Base64Utils
public Base64Utils()
-
-
方法详细资料
-
decode
BASE64字符串解码为二进制数据
- 参数:
base64-- 返回:
- 抛出:
Exception
-
encode
二进制数据编码为BASE64字符串
- 参数:
bytes-- 返回:
- 抛出:
Exception
-
encodeFile
将文件编码为BASE64字符串
大文件慎用,可能会导致内存溢出
- 参数:
filePath- 文件绝对路径- 返回:
- 抛出:
Exception
-
decodeToFile
BASE64字符串转回文件
- 参数:
filePath- 文件绝对路径base64- 编码字符串- 抛出:
Exception
-
fileToByte
文件转换为二进制数组
- 参数:
filePath- 文件路径- 返回:
- 抛出:
Exception
-
byteArrayToFile
二进制数据写文件
- 参数:
bytes- 二进制数据filePath- 文件生成目录- 抛出:
Exception
-