Java Stream Close close(Closeable closeable, Logger logger)

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

Description

close

License

Apache License

Declaration

public static void close(Closeable closeable, Logger logger) 

Method Source Code


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

import org.slf4j.Logger;
import java.io.Closeable;
import java.io.IOException;

public class Main {
    public static void close(Closeable closeable, Logger logger) {

        if (closeable == null) {
            return;
        }// ww w .j a v a  2 s.c om

        try {
            closeable.close();

        } catch (IOException e) {
            logger.error("Error closing closeable", e);
        }
    }
}

Related

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