Has anyone ever seen an exception thrown when calling close method on any closable object?
Has anyone ever seen an exception thrown when calling close method on any closable
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
An
IOExceptionwill be thrown oncloseif the finalflushfails. Possible causes include:OutputStreamWriteror similar,I have certainly seen some of these. Others are unlikely.
However, if the data you are writing is important then you should allow for
closefailing. For example, if your application is writing out a critical file the file system fills up, your application had better notice this before it replaces the old copy of the file with the truncated version.