I/O
来源:互联网 发布:苹果手机数据恢复公司 编辑:程序博客网 时间:2024/06/06 00:15
一、输入流(读)
File file = new FIle(String path);
InputStream is = new FileInputStream(file);
FileOutputStream os = null;
os = new FileOutputStream(outfile);
byte[] b = new byte[1024];
int c;
String result="";
BASE64Encoder encoder = new BASE64Encoder();
/* //对输入流加密
while((c=is.read(b))!=-1){
result += encoder.encoder(b);
}
return result;
*/
while((c=is.read(b))!=-1){
os.write(b, 0, c);
}
if(is !=null){
try {
is.close();
} catch (IOException e) {
e.printStackTrace();
}
}
if(os!=null){
try {
os.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
阅读全文
0 0
- I/O
- I/O
- I/O
- I/O
- I/O
- I/O
- I/O
- I/O
- I/O
- i/o
- I/O
- I/O
- I/O
- I/O
- I/O
- I/O
- I/O
- I/O
- 2,组合模式
- 持续集成之Jenkins+Gitlab简介 [一]
- sitemesh3配置细节
- eclipse快捷键
- IDEA中Ctrl+Shift+f快捷键无效的解决方式
- I/O
- error C1010: 在查找预编译头时遇到意外的文件结尾。是否忘记了向源中添加“#include "StdAfx.h"”?
- 自媒体批量注册的方法
- dll文件的c++制作
- 看病要排队(优先队列)
- Python01_基础
- 持续集成之Jenkins+Gitlab实现持续集成 [二]
- web项目总结-----1
- spring配置文件详解--真的蛮详细