标签:java txt
package readAndWrite; import java.io.*; public class TXT { public static void main(String[] args) throws IOException { String readSource = "F:\\ReadTXT.txt"; FileInputStream fis = new FileInputStream(readSource); InputStreamReader isr = new InputStreamReader(fis); BufferedReader br = new BufferedReader(isr); String writeDest = "F:\\WriteTXT.txt"; File file = new File(writeDest); FileWriter fw = new FileWriter(file); BufferedWriter bw = new BufferedWriter(fw); String line; for(;(line=br.readLine())!=null;){ bw.write(line); bw.write("\r\n"); } bw.close(); fw.close(); br.close(); isr.close(); fis.close(); } }
标签:java txt
原文地址:http://smileyes.blog.51cto.com/6027700/1678093