Here you can find the source of close(Closeable resource)
public static boolean close(Closeable resource)
//package com.java2s; //License from project: Open Source License import java.io.Closeable; public class Main { public static boolean close(Closeable resource) { boolean result = false; if (resource != null) { try { resource.close();/*from ww w . j av a 2s . c o m*/ result = true; } catch (Exception e) { // exception swallowed on purpose } } return result; } }