Here you can find the source of closeSafe(InputStream inputStream)
public static void closeSafe(InputStream inputStream) throws Exception
//package com.java2s; //License from project: Apache License import java.io.InputStream; import java.io.OutputStream; public class Main { public static void closeSafe(InputStream inputStream) throws Exception { if (inputStream != null) { inputStream.close();/* www .j av a 2s .c om*/ } } public static void closeSafe(OutputStream outputStream) throws Exception { if (outputStream != null) { outputStream.close(); } } }