Here you can find the source of closeAllStreamsQuietly(final Closeable... closeables)
Parameter | Description |
---|---|
closeables | - The list of <tt>Closeable</tt> object to close. |
public static void closeAllStreamsQuietly(final Closeable... closeables)
//package com.java2s; //License from project: Open Source License import java.io.Closeable; import java.io.IOException; public class Main { /**//ww w . j a va 2 s . co m * Closes a list of <tt>Closeable</tt> objects quietly.<br> * The specified list may contain objects with null <tt>null</tt> values. * * @param closeables - The list of <tt>Closeable</tt> object to close. * @see #closeStreamQuietly(Closeable) */ public static void closeAllStreamsQuietly(final Closeable... closeables) { for (Closeable aCloseable : closeables) { closeStreamQuietly(aCloseable); } } /** * 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. } } }