Example usage for java.io Closeable close

List of usage examples for java.io Closeable close

Introduction

In this page you can find the example usage for java.io Closeable close.

Prototype

public void close() throws IOException;

Source Link

Document

Closes this stream and releases any system resources associated with it.

Usage

From source file:Main.java

public static void closeQuietly(Closeable closeable) {
    if (closeable != null) {
        try {//from www. j  a v  a 2s. com
            closeable.close();
        } catch (Exception ex) {
            // ignore
        }
    }
}

From source file:Main.java

public static void closeSilently(Closeable closeable) {
    if (closeable != null) {
        try {/* w w w  .ja v a 2s .  c  om*/
            closeable.close();
        } catch (Throwable t) {
            //
        }
    }
}

From source file:Main.java

public static void closeQuietly(Closeable closeable) {
    if (closeable != null) {
        try {//ww w.j  av a  2  s.co  m
            closeable.close();
        } catch (IOException e) {
        }
    }
}

From source file:Main.java

public static void close(Closeable c) {
    if (c != null) {
        try {/*from   ww  w . j a v  a 2 s . c  o  m*/
            c.close();
        } catch (IOException ex) {
            ex.printStackTrace();
        }
    }
}

From source file:Main.java

public static boolean close(Closeable closeable) {
    if (closeable != null)
        try {/*from  ww  w  .  j a v a2s. c  om*/
            closeable.close();
            return true;
        } catch (IOException e) {
        }
    return false;
}

From source file:Main.java

private static void close(Closeable closeable) {
    try {//from w  w w  .  j a v a  2s  .  c  om
        if (closeable != null) {
            closeable.close();
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}

From source file:Main.java

public static void close(Closeable closeable) {
    if (closeable != null) {
        try {/*from  w ww .  ja  v  a  2  s .co  m*/
            closeable.close();
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
}

From source file:Main.java

public static void closeQuietly(Closeable closeable) {
    try {/* w  w w.  java  2  s .c  o  m*/
        if (closeable != null) {
            closeable.close();
        }
    } catch (IOException ignored) {
    }
}

From source file:Main.java

public static void closeSafely(Closeable closeable) {
    if (closeable != null) {
        try {//from  w ww. j a v a 2s  . co  m
            closeable.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

From source file:Main.java

public static void closeQuietly(Closeable closeable) {
    if (null != closeable) {
        try {/*  w w w. j  a  v  a2s. c  om*/
            closeable.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}