Here you can find the source of close(final InputStream stream)
public static void close(final InputStream stream)
//package com.java2s; /**/*from w ww . j a v a 2 s. co m*/ * Copyright (c) 2009 Farata Systems http://www.faratasystems.com * * Licensed under The MIT License * Re-distributions of files must retain the above copyright notice. * * @license http://www.opensource.org/licenses/mit-license.php The MIT License * */ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class Main { public static void close(final InputStream stream) { if (stream == null) { return; } try { stream.close(); } catch (IOException e) { e.printStackTrace(); } } public static void close(final OutputStream stream) { if (stream == null) { return; } try { stream.close(); } catch (final IOException e) { e.printStackTrace(); } } }