2个回答
展开全部
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
public class filmchange {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
File flsou=new File("E:/a.txt");
File fldec=new File("E:/b.txt");
String context="";
try{
FileReader fr=new FileReader(flsou);
FileWriter fw=new FileWriter(fldec);
BufferedReader br = new BufferedReader(fr);
BufferedWriter bw=new BufferedWriter(fw);
while(br.ready()){
context=br.readLine();
bw.write(context);
bw.newLine();
bw.flush();
}
bw.close();
br.close();
fw.close();
fr.close();
}catch(Exception ex){
}
}
}
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
public class filmchange {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
File flsou=new File("E:/a.txt");
File fldec=new File("E:/b.txt");
String context="";
try{
FileReader fr=new FileReader(flsou);
FileWriter fw=new FileWriter(fldec);
BufferedReader br = new BufferedReader(fr);
BufferedWriter bw=new BufferedWriter(fw);
while(br.ready()){
context=br.readLine();
bw.write(context);
bw.newLine();
bw.flush();
}
bw.close();
br.close();
fw.close();
fr.close();
}catch(Exception ex){
}
}
}
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
FileInputStream fis = new FileInputStream("E:\a.txt");
FileOutputStream fos = new FileOutputStream("E:\b.txt");
byte[] b = new byte[1024];
int len = -1;
while ( (len=fis.read(b))!=-1 ) {
fos.write(b,0,len);
}
fis.close();
fos.close();
FileOutputStream fos = new FileOutputStream("E:\b.txt");
byte[] b = new byte[1024];
int len = -1;
while ( (len=fis.read(b))!=-1 ) {
fos.write(b,0,len);
}
fis.close();
fos.close();
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询