Here you can find the source of closeSilently(Object obj, Closeable stream)
public static void closeSilently(Object obj, Closeable stream)
//package com.java2s; //License from project: LGPL import java.io.Closeable; import java.io.IOException; import java.util.logging.Level; import java.util.logging.Logger; public class Main { public static void closeSilently(Object obj, Closeable stream) { if (stream == null) { return; }/*from w w w. ja v a2 s. c om*/ try { stream.close(); } catch (IOException e) { Logger.getLogger(obj.getClass().getName()).log(Level.WARNING, "Error occured while closing a stream.", e); } } public static void closeSilently(Closeable stream) { if (stream == null) { return; } try { stream.close(); } catch (IOException e) { Logger.getLogger("Utils").log(Level.WARNING, "Error occured while closing a stream.", e); } } }