Here you can find the source of close(Closeable stream)
public static void close(Closeable stream)
//package com.java2s; //License from project: Apache License import java.io.Closeable; import java.io.IOException; public class Main { public static void close(Closeable stream) { if (stream == null) { return; }// w w w .jav a2s. c o m try { stream.close(); } catch (IOException ioe) { } } public static void close(Closeable... streams) { if ((streams == null) || (streams.length == 0)) { return; } for (Closeable c : streams) { try { if (c != null) { c.close(); } } catch (IOException ioe) { } } } }