Here you can find the source of closeAll(T... io)
public static <T extends Closeable> void closeAll(T... io)
//package com.java2s; //License from project: Open Source License import java.io.Closeable; public class Main { public static <T extends Closeable> void closeAll(T... io) { for (Closeable temp : io) { try { if (null != temp) { temp.close();// w ww . j a v a2s . c om } } catch (Exception e) { } } } public static void close(Closeable... io) { for (Closeable temp : io) { try { if (null != temp) { temp.close(); } } catch (Exception e) { } } } }