更新代码

This commit is contained in:
maxf 2018-12-24 15:25:42 +08:00
parent be42378156
commit 30ce976b27

View File

@ -323,6 +323,33 @@ public class ImgUtil {
return rs;
}
/**
* base64转文件
*
* @param decode baseByte
* @param fileName 文件名称包含路径
* @return 返回保存地址
*/
public static String base64ToFile(byte[] decode, String fileName) {
FileOutputStream out = null;
try {
out = new FileOutputStream(fileName);
out.write(decode);
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
try {
if (out != null) {
out.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
return fileName;
}
public static class ImageInfo {
/**
* 图片大小