Java Stream Close closeQuietly(InputStream input)

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

Description

close Quietly

License

Apache License

Declaration

public static void closeQuietly(InputStream input) 

Method Source Code


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

import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

public class Main {
    public static void closeQuietly(InputStream input) {
        closeQuietly((Closeable) input);
    }/*  w  w  w  .ja  v a 2  s .c om*/

    public static void closeQuietly(OutputStream output) {
        closeQuietly((Closeable) output);
    }

    public static void closeQuietly(Closeable closeable) {
        try {
            if (closeable != null) {
                closeable.close();
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public static void closeQuietly(Closeable... closeables) {
        for (Closeable closeable : closeables) {
            closeQuietly(closeable);
        }
    }
}

Related

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