Here you can find the source of close(InputStream in)
Parameter | Description |
---|---|
in | the stream |
public static final void close(InputStream in)
//package com.java2s; import java.io.InputStream; import java.io.OutputStream; import java.io.RandomAccessFile; import java.io.Reader; import java.io.Writer; public class Main { /**/*w ww. j av a 2 s. c o m*/ * Attempts to close the stream, suppressing all exceptions. * * @param in * the stream */ public static final void close(InputStream in) { try { in.close(); } catch (Exception e) { // do nothing } } /** * Attempts to close the file, suppressing all exceptions. * * @param raf * the file * @param raf */ public static final void close(RandomAccessFile raf) { try { raf.close(); } catch (Exception e) { // do nothing } } /** * Attempts to close the stream, suppressing all exceptions. * * @param out * the stream */ public static final void close(OutputStream out) { try { out.close(); } catch (Exception e) { // do nothing } } /** * Attempts to close the reader, suppressing all exceptions. * * @param in * the reader */ public static final void close(Reader in) { try { in.close(); } catch (Exception e) { // do nothing } } /** * Attempts to close the writer, suppressing all exceptions. * * @param out * the writer */ public static final void close(Writer out) { try { out.close(); } catch (Exception e) { // do nothing } } }