Java Stream Close closeRelaxed(Closeable resource)

Here you can find the source of closeRelaxed(Closeable resource)

Description

Close the given resource relaxed.

License

Open Source License

Parameter

Parameter Description
resource The resource to be closed.

Declaration

public static void closeRelaxed(Closeable resource) 

Method Source Code


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

import java.io.Closeable;
import java.io.IOException;

public class Main {
    /**/* w  w  w  .j  ava2s  .  co  m*/
     * Close the given resource relaxed.
     *
     * @param resource The resource to be closed.
     */
    public static void closeRelaxed(Closeable resource) {
        if (resource != null) {
            try {
                resource.close();
            } catch (IOException ignore) {
                // Ignored by definition
            }
        }
    }
}

Related

  1. closeReader(final Reader reader)
  2. closeReader(Reader r)
  3. closeReader(Reader reader)
  4. closeReader(Reader reader)
  5. closeReader(Reader rReader)
  6. closeReportFile()
  7. closeResource(final Closeable aResource)
  8. closeSafe(InputStream inputStream)
  9. closeSafely(final FileOutputStream output)