...
...
try{
 FileInputStream a = new ...();
 FileOutputStream b= new ...();
 // ...
 a.close;
 b.close;
}catch (IOException e){
  e.printStackTrace();
} finally{
//how to handle it here}
...
}
}

解决方案 »

  1.   

    不用管它。另外你这个写法不正确。应该是:FileInputStream a = null;
    FileOutputStream b = null;try {
        ...
    } finally {
        try {
            if (a != null) a.close();
        } catch (IOException e) {
            /* 什么都不用做 */
        }    try {
            if (b != null) b.close();
        } catch (IOException e) {
            /* 什么都不用做 */
        }
      

  2.   

    顶沙发,流和文件句柄都是需要显式关闭的,放在finally块中即可。