Here you can find the source of close(InputStream is)
public static void close(InputStream is)
//package com.java2s; //License from project: Apache License import java.io.*; public class Main { public static void close(Reader reader) { try {/*from w w w .ja v a2s . co m*/ if (reader != null) reader.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } public static void close(InputStream is) { try { if (is != null) is.close(); } catch (IOException e) { e.printStackTrace(); } } public static void close(OutputStream os) { try { if (os != null) { os.flush(); os.close(); } } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }