Here you can find the source of close(InputStream inputStream)
public static void close(InputStream inputStream) throws IOException
//package com.java2s; /******************************************************************************* * Copyright (c) 2011 Red Hat, Inc. /*ww w . j a v a 2s.co m*/ * Distributed under license by Red Hat, Inc. All rights reserved. * This program is made available under the terms of the * Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Red Hat, Inc. - initial API and implementation ******************************************************************************/ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.Reader; import java.io.Writer; public class Main { public static void close(InputStream inputStream) throws IOException { if (inputStream != null) { inputStream.close(); } } public static void close(OutputStream outputStream) throws IOException { if (outputStream != null) { outputStream.close(); } } public static void close(Reader reader) throws IOException { if (reader != null) { reader.close(); } } public static void close(Writer writer) throws IOException { if (writer != null) { writer.close(); } } }