图解:
方式一:
FileReader fr=new FileReader("def");
FileWriter fw=new FileWriter("ss");
int length=0;
while((length=fr.read())!=-1)
{
fw.write(length);
}
fr.close();
fw.close();
方式二:
FileReader fr=new FileReader("abc");
FileWriter fw=new FileWriter("def",true);
char [] ch=new char[1024];
int length=0;
while ((length=(fr.read(ch)))!=-1)
{
fw.write(ch, 0, length);
}
fw.close();
fr.close();