代码拉取完成,页面将自动刷新
同步操作将从 Rainy/DocSys 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
/**
*
*/
package util;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import com.ibm.misc.BASE64Decoder;
/**
* @author Administrator
*
*/
public class Base64File {
/**
* @param args
*/
public static void main(String[] args) {
decode("MTIzYWJj","D:\\","qq.txt");
}
/**
* 直接将解密内容写入文件
*
* @param bytes
* @param path
* @param file
*/
public static void decode(String bytes, String path, String file) {
byte[] content = decode(bytes);
FileOutputStream fos = null;
try {
File dir = new File(path);
if (!dir.exists()) {
DebugHelper.print("文件夹" + path + "不存在");
dir.mkdir();
}
System.out.println( "s " + dir.setWritable(true));
System.out.println( "w " + dir.canWrite());
System.out.println( "r " + dir.canRead());
DebugHelper.print( "重新检测" + dir.exists() );
fos = new FileOutputStream(path + file);
fos.write(content);
} catch (Exception e) {
DebugHelper.print(e.toString());
} finally {
try {
fos.close();
} catch (IOException e) {
// 不做处理
}
}
}
/**
* 将字符串解密
*
* @param bytes
* @return
*/
public static byte[] decode(String data) {
if (null == data) {
return null;
}
BASE64Decoder decoder = new BASE64Decoder();
try {
byte[] ret = decoder.decodeBuffer(data);
return ret;
} catch (Exception e) {
DebugHelper.print(e.toString());
return null;
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。