Base64Util canSave the file generated by Base64 decoding to the specified path; or convert the file into Base64 code, supported language: java.

<!-- https://mvnrepository.com/artifact/icu.xuyijie/Base64Utils -->
<dependency>
    <groupId>icu.xuyijie</groupId>
    <artifactId>Base64Utils</artifactId>
    <version>1.2.3</version>
</dependency>
// 将文件编码成Base64,可传入文件全路径,或者一个 File 对象
String s = Base64Util.transferToBase64("D:/下载/Screenshot_20221008-090627.png");
File file = new File(filePath);
String s = Base64Util.transferToBase64(file);
System.out.println(s);
// 将Base64转换成文件保存到指定位置,可传入文件全路径或者分别传入保存位置和文件名
String s1 = Base64Util.generateFile(s, "D:/下载/aaa.png");
String s1 = Base64Util.generateFile(s, "D:/下载", "aaa.png");
System.out.println(s1);

#Base64Util #Homepage #Documentation #Download #Base64 #Codec #Tool #News Fast Delivery

Leave a Comment

Your email address will not be published. Required fields are marked *