Friday, October 08, 2010

Don't swallow IOException from OutputStream.close().

If OutputStream throws IOException on close then probably the whole write failed and left the data in a buffer i.e., nothing happened. So don't swallow this exception when you close an OutputStream.

From the Java Posse #299 Devoxx 09 - Project Lombok Interview, 18 mins 10 seconds in.

This is a good reason to support Joshua Bloch's ARM Block proposal.