IO流的标准处理代码

FileInputStream fis = null;

FileOutputStream fos = null;

try {

  fis = new FileInputStream("aaa.txt");

  fos = new FileOutputStream("bbb.txt");

  int b;

  while((b = fis.read()) != -1) {

    fos.write(b);

  }

  } finally {

  try {

    if(fis != null)
  
    fis.close();

  }finally {

    if(fos != null)

    fos.close();

  }

}

 

posted on 2017-02-16 21:30  LoaderMan  阅读(347)  评论(0)    收藏  举报

导航