Yesenfei

merge try catch, and check writer != null & close() at last.