Java Stream Close closeQuietly(InputStream stream)

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

Description

Quietly close a given stream, suppressing exceptions.

License

Open Source License

Parameter

Parameter Description
stream a parameter

Declaration

public static void closeQuietly(InputStream stream) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.io.IOException;
import java.io.InputStream;

public class Main {
    /**//from   w w w  .j a v a2  s .c  o  m
     * Quietly close a given stream, suppressing exceptions.
     *
     * @param stream
     */
    public static void closeQuietly(InputStream stream) {
        if (stream == null) {
            return;
        }
        try {
            stream.close();
        } catch (IOException e) {
        }
    }
}

Related

  1. closeQuietly(InputStream is)
  2. closeQuietly(InputStream is)
  3. closeQuietly(InputStream is)
  4. closeQuietly(InputStream is)
  5. closeQuietly(InputStream is)
  6. closeQuietly(InputStream x)
  7. closeQuietly(java.io.Closeable writer)
  8. closeQuietly(Object input)
  9. closeQuietly(Object obj)