Java Stream Close closeQuietly(InputStream is)

Here you can find the source of closeQuietly(InputStream is)

Description

close Quietly

License

Apache License

Declaration

public static void closeQuietly(InputStream is) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.io.*;

public class Main {
    /**/*from   www.  j a  va2s .c o  m*/
     * @param c
     */
    public static void closeQuietly(Closeable c) {
        try {
            if (c != null)
                c.close();
        } catch (IOException ignored) {
        }
    }

    /**
     * @param raf
     */
    public static void closeQuietly(RandomAccessFile raf) {
        try {
            if (raf != null)
                raf.close();
        } catch (IOException ignored) {
        }
    }

    public static void closeQuietly(InputStream is) {
        try {
            if (is != null)
                is.close();
        } catch (IOException ignored) {
        }
    }

    public static void closeQuietly(Reader r) {
        try {
            if (r != null)
                r.close();
        } catch (IOException ignored) {
        }
    }

    public static void closeQuietly(OutputStream os) {
        try {
            if (os != null)
                os.close();
        } catch (IOException ignored) {
        }
    }

    public static void closeQuietly(Writer w) {
        try {
            if (w != null)
                w.close();
        } catch (IOException ignored) {
        }
    }
}

Related

  1. closeQuietly(InputStream input)
  2. closeQuietly(InputStream input)
  3. closeQuietly(InputStream inputstream)
  4. closeQuietly(InputStream is)
  5. closeQuietly(InputStream is)
  6. closeQuietly(InputStream is)
  7. closeQuietly(InputStream is)
  8. closeQuietly(InputStream is)
  9. closeQuietly(InputStream is)