apache commons-codec base64将文件转为字符串
来源:互联网 发布:苹果软件商店图标 编辑:程序博客网 时间:2024/06/05 02:46
- public String getFileByteString(File file) throws Exception{
- Base64 b64 = new Base64();
- FileInputStream fis = new FileInputStream(file);
- System.out.print(file.length());
- byte[] buffer = new byte[(int)file.length()];
- System.out.print(buffer.length);
- fis.read(buffer);
- fis.close();
- return b64.encodeToString(buffer);
- }
- /**
- *
- * 把读到的文件串转存
- */
- public void getFileByString(String string, String target) throws Exception{
- Base64 b64 = new Base64();
- byte[] buffer = b64.decode(string);
- FileOutputStream fos = new FileOutputStream(target);
- fos.write(buffer);
- fos.close();
- }
0 0
- 使用apache commons-codec base64将文件转为字符串
- apache commons-codec base64将文件转为字符串
- Base64 Java org.apache.commons.codec.binary.Base64
- 使用Apache commons-codec Base64实现加解密
- org.apache.commons.codec.binary.Base64 加密解密
- org.apache.commons.codec.binary.Base64图片加密解密
- 使用Apache commons-codec Base64实现加解密
- org.apache.commons.codec.binary.Base64 加密解密
- [随手记]Android import org.apache.commons.codec.binary.Base64
- 使用org.apache.commons.codec做md5&SHA1&BASE64加密
- Apache commons codec |MD5 SHA BASE64 简单方便操作
- org.apache.commons.codec.binary.Base64 加密解密
- 使用Apache commons-codec Base64实现加解密(转)
- 使用commons-codec包加密字符串(MD5,SHA1,BASE64)
- 使用commons-codec包加密字符串(MD5,SHA1,BASE64)
- 使用commons-codec包加密字符串(MD5,SHA1,BASE64)
- Apache Commons:Commons-codec介绍
- apache-commons-codec(1)
- Lucene学习总结二
- [译]Android图形系统 II 图形架构
- 如何在CentOS 7.x中安装OpenERP(Odoo)
- 利用BurpSuite爆破学校教务处弱密码学号
- wordpress 常用函数
- apache commons-codec base64将文件转为字符串
- 动态添加菜单/菜单项、子菜单、右键菜单
- 希尔排序
- JS表单提交验证
- 搭建DirectUi开发平台
- 海恩法则
- 《从零开始学Swift》学习笔记(Day 33)——属性观察者
- svn命令在linux下的使用
- Wireless之无线信道