Here you can find the source of closeQuietly(Object object)
public static void closeQuietly(Object object)
//package com.java2s; //License from project: Open Source License import java.io.*; public class Main { public static void closeQuietly(Object object) { if (object != null) { try { if (object instanceof Closeable) { ((Closeable) object).close(); } else if (object instanceof InputStream) { ((InputStream) object).close(); } else if (object instanceof OutputStream) { ((OutputStream) object).close(); } else if (object instanceof Reader) { ((Reader) object).close(); } else if (object instanceof Writer) { ((Writer) object).close(); }//from ww w . j a v a2s . co m } catch (Exception e) { } } } }