标签:
package h15; import java.io.*; public class BufferedReaderDemo { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub BufferedReader br = null; BufferedWriter bw = null; FileReader fr; FileWriter fw; try { fr = new FileReader("e:/a.txt"); fw = new FileWriter("e:/c.txt"); br = new BufferedReader(fr); bw = new BufferedWriter(fw); String s=""; while((s=br.readLine())!=null){ bw.write(s); } } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); }finally{ try { br.close(); bw.close(); } catch (Exception e2) { // TODO: handle exception e2.printStackTrace(); } } } }
BufferedReader 和 BufferedWriter
标签:
原文地址:http://www.cnblogs.com/hzzhero/p/4575263.html