Android Stream Close close(Closeable closeable)

Here you can find the source of close(Closeable closeable)

Description

Closes a resource stream if the Closeable is not null, any exceptions will be swallowed.

Parameter

Parameter Description
closeable the closeable to close

Declaration

public static void close(Closeable closeable) 

Method Source Code

//package com.java2s;

import java.io.Closeable;

import java.io.IOException;

public class Main {
    /**//w  w w .  j a  va  2 s .c  om
     * Closes a resource stream if the {@link Closeable} is not null, any exceptions will be swallowed.
     *
     * @param closeable
     *            the closeable to close
     */
    public static void close(Closeable closeable) {
        if (closeable != null) {
            try {
                closeable.close();
            } catch (IOException e) {
                // noop
            }
        }
    }
}

Related

  1. closeOutputStream(OutputStream os)
  2. closeQuietly(Closeable closeable)
  3. closeQuitely(Closeable c)
  4. closeStream(Closeable stream)