Here you can find the source of closeQuietly(InputStream input)
Parameter | Description |
---|---|
input | A (possibly null) InputStream |
public static void closeQuietly(InputStream input)
//package com.java2s; import java.io.*; public class Main { /**//from w w w . ja va 2s. com * @param input A (possibly null) Reader */ public static void closeQuietly(Reader input) { if (input == null) { return; } try { input.close(); } catch (IOException ioe) { } } /** * @param output A (possibly null) Writer */ public static void closeQuietly(Writer output) { if (output == null) { return; } try { output.close(); } catch (IOException ioe) { } } /** * @param output A (possibly null) OutputStream */ public static void closeQuietly(OutputStream output) { if (output == null) { return; } try { output.close(); } catch (IOException ioe) { } } /** * @param input A (possibly null) InputStream */ public static void closeQuietly(InputStream input) { if (input == null) { return; } try { input.close(); } catch (IOException ioe) { } } }