用内存流读写文件
来源:互联网 发布:java 查询淘宝ip地址 编辑:程序博客网 时间:2024/06/04 18:14
import java.io.*;
public class Text {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
try{
File read = new File("e://1.txt");
File write = new File("e://2.txt");
BufferedReader br = new BufferedReader(
new FileReader(read));
BufferedWriter bw = new BufferedWriter(
new FileWriter(write));
String temp = null;
temp = br.readLine();
while(temp != null){
//写文件
bw.write(temp + "/r/n"); //只适用Windows系统
//继续读文件
temp = br.readLine();
}
bw.close();
br.close();
}catch(FileNotFoundException e){ //文件未找到
System.out.println (e);
}catch(IOException e){
System.out.println (e);
}
}
}
- 用内存流读写文件
- 用内存映射读写大文件
- Python - I/O 文件读写 内存读写
- 内存映射,快速读写文件
- (转)mapViewOfFile内存文件读写
- 使用内存映射文件读写大文件
- 使用内存映射文件读写大文件
- 使用内存映射文件读写大文件
- 用流读写csv文件
- 内存流的读写
- 内存读写流
- Windows的内存映射,大文件读写
- C# 文件读写与内存资源泄漏
- 使用SharedPreferences读写文件到内存
- 读写文件(内存,sd等多种) Android
- Linux C++内存映射方式读写文件
- 用共享内存读写数据
- 文件读写和流
- Div+Css酷站一箩筐
- 无限级菜单结构 与 Javascript 实现算法, 类 XMenu by shawl.qiu
- 学习JAVA多线程程序设计(一)
- 阿拉伯数字转换为中国的大写数字
- struts和hibernate和spring的优缺点
- 用内存流读写文件
- 关于MVC的一点启示(转)
- 深拷贝和浅拷贝(整理)
- IBM e-learning : The Priority Matrix – Lesson Overview
- IBM e-learning : The Priority Matrix – Building a Priority Matrix
- IBM e-learning : The Priority Matrix – Gain More Time
- IBM e-learning : Most Valuable Time of Your Day – Lesson Overview
- IBM e-learning : Most Valuable Time of Your Day – Prime Times and Down Times
- IBM e-learning : Most Valuable Time of Your Day – Controllable Time