Java Stream Close closeIgnoringExceptions(Closeable c)

Here you can find the source of closeIgnoringExceptions(Closeable c)

Description

Helper method use to close a Closeable ignoring eventual exception

License

Open Source License

Parameter

Parameter Description
c the closeable

Declaration

public static final void closeIgnoringExceptions(Closeable c) 

Method Source Code

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

import java.io.Closeable;

public class Main {
    /**//w  w  w  .  j a v a2s .  c  o  m
     * Helper method use to close a {@link Closeable} ignoring eventual exception
     * 
     * @param c
     *            the closeable
     */
    public static final void closeIgnoringExceptions(Closeable c) {
        try {
            if (c != null) {
                c.close();
            }
        } catch (Throwable _) {
        }
    }
}

Related

  1. closeHTML(String pageTemplate, PrintStream out)
  2. closeIgnoreExceptions(Closeable c)
  3. closeIgnoreExceptions(Closeable stream)
  4. closeIgnoreIOEx(ByteArrayOutputStream baos)
  5. closeIgnoringException(final Closeable closeable)
  6. closeIgnoringExceptions(Closeable c)
  7. closeImage()
  8. closeIncludeGuard(String name, PrintWriter writer)
  9. closeInput(InputStream src)