I prefer to use com.google.common.io.Closeables.closeQuietly(). It makes code more readable.