标签:www 代码 system int buffere stat public txt pac
package www.tainiu.wenjian; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; public class af__FileHuanZiFuLiu__V1 { public static void main(String[] args) { // TODO Auto-generated method stub BufferedReader br= null; BufferedWriter bw= null; try { FileReader fr= new FileReader("d:\\Test.txt"); br= new BufferedReader(fr); FileWriter fw= new FileWriter("e:\\Test__1.txt"); bw= new BufferedWriter(fw); String s= ""; while((s=br.readLine()) != null) { //System.out.println(s); bw.write(s + "\r\n"); } } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } finally { try {br.close();bw.close();} catch (IOException e) {e.printStackTrace();} } } }
package www.tainiu.wenjian; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; public class af__FileHuanZiFuLiu__V2 { public static void main(String[] args) { // TODO Auto-generated method stub BufferedReader br= null; BufferedWriter bw= null; try { //FileReader fr= new FileReader("d:\\Test.txt"); br= new BufferedReader(new FileReader("d:\\Test.txt")); //FileWriter fw= new FileWriter("e:\\Test__1.txt"); bw= new BufferedWriter(new FileWriter("e:\\Test__2.txt")); String s= ""; while((s=br.readLine()) != null) { //System.out.println(s); bw.write(s + "\r\n"); } } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } finally { try {br.close();bw.close();} catch (IOException e) {e.printStackTrace();} } } }
标签:www 代码 system int buffere stat public txt pac
原文地址:http://www.cnblogs.com/wujianbo123/p/7633137.html