FileWriter fw=null; FileReader fr=null; try{ fw=new FileWriter(“文件名”); fr=new FileReader(“文件名”); char[] buff=new char[1024]; int num=0; While((num=fr.read(buff))!=-1){ fw.writer(buff,0,num); } }catch(IOException e){ }finally{ if(fw!=null) try{ fw.close(); }catch(IOException e){ }finally{ if(fr!=null) try{ fr.close(); }catch(IOException e){ } } }
|