Here you can find the source of closeSafely(InputStream is)
public static void closeSafely(InputStream is)
//package com.java2s; import java.io.InputStream; import java.io.OutputStream; import java.io.Reader; public class Main { public static void closeSafely(InputStream is) { try {//from w w w . j a v a 2s . c om if (is != null) is.close(); } catch (Throwable e) { } } public static void closeSafely(OutputStream os) { try { if (os != null) os.close(); } catch (Throwable e) { } } public static void closeSafely(Reader r) { try { if (r != null) r.close(); } catch (Throwable e) { } } }