Java Stream Close close(Closeable closeable, boolean swallowIOException)

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

Description

close

License

Apache License

Declaration

public static void close(Closeable closeable, boolean swallowIOException) throws IOException 

Method Source Code

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

import java.io.Closeable;

import java.io.IOException;

public class Main {
    public static void close(Closeable closeable, boolean swallowIOException) throws IOException {
        if (closeable != null) {
            try {
                closeable.close();/* ww w . j  a va2 s  .c om*/
            } catch (IOException e) {
                if (!swallowIOException) {
                    throw e;
                }
            }
        }
    }
}

Related

  1. close(BufferedReader br)
  2. close(BufferedWriter bufferedWriter)
  3. close(ClassLoader cl)
  4. close(Closeable bufferedInputStream)
  5. close(Closeable closeable, boolean ignoreException)
  6. close(Closeable closeable, Logger logger)
  7. close(Closeable io, Logger logger)
  8. close(Closeable resource)
  9. close(Closeable resource)