Here you can find the source of closeStreamQuietly(final Closeable closeable)
Parameter | Description |
---|---|
closeable | - The stream to close, if <tt>null</tt> nothing is done. |
public static void closeStreamQuietly(final Closeable closeable)
//package com.java2s; //License from project: Open Source License import java.io.Closeable; import java.io.IOException; public class Main { /**/*w w w . ja va2 s . c o m*/ * Close quietly an object which implements the {@link Closeable} interface * such as <tt>InputStream</tt>, <tt>OutputStream</tt>, <tt>Reader</tt> ... * * @param closeable - The stream to close, if <tt>null</tt> nothing is done. * @see #closeAllStreamsQuietly(Closeable...) */ public static void closeStreamQuietly(final Closeable closeable) { try { if (closeable != null) closeable.close(); } catch (IOException ioe) { // Do nothing. } } }