Here you can find the source of closeStream(final InputStream in)
Parameter | Description |
---|---|
in | Input stream to close. |
public static void closeStream(final InputStream in)
//package com.java2s; /* See LICENSE for licensing and NOTICE for copyright. */ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class Main { /**/* w w w.j a va 2s.co m*/ * Closes the given stream and swallows exceptions that may arise during the * process. * * @param in Input stream to close. */ public static void closeStream(final InputStream in) { try { in.close(); } catch (IOException e) { System.err.println("Error closing " + in + ": " + e); } } /** * Closes the given stream and swallows exceptions that may arise during the * process. * * @param out Output stream to close. */ public static void closeStream(final OutputStream out) { try { out.close(); } catch (IOException e) { System.err.println("Error closing " + out + ": " + e); } } }