将f://files//java import java.io.*;文件拷贝到D://text.txt目录 有问题真 哪位帮忙看下 实在找不着了
class Buff
{
public static void main(String[] args)
{
BufferedReader bufr=null;
BufferedWriter bufw=null;
try
{
BufferedReader bufr=new BufferedReader(new FileInputStream("f://files//java "));
BufferedWriter bufw= new BufferedWriter(new FileOutputStream("D://text.txt "));
String line=null;
while((line=bufr.readLine())!=null)
{
bufw.write(line);
bufr.newLine();
bufw.flush();
}
catch (IOException e)
{
throw RuntimeException("文件读写失败");
}
finally
{
try
{
if(bufr!=null)
bufr.close();
}
catch (IOException e)
{
throw new RuntimeException("读关闭失败");
}
try
{
if(bufw!=null)
bufw.close();
}
catch (IOException e)
{
throw new RuntimeException("写关闭失败");
}
}
}
|