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 close(Closeable closeable) {
    if (closeable != null) {
        try {//  ww  w .j  a v a2 s . c  o m
            closeable.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

From source file:Main.java

public static void close(Closeable closeable) {
    if (closeable != null) {
        try {/* w ww.  j  av a2 s. co m*/
            closeable.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

From source file:Main.java

public static void closeQuietly(Closeable closeable) {
    if (closeable != null) {
        try {/*  ww w.ja va  2 s .c  om*/
            closeable.close();
        } catch (Exception e) {
            // no op
        }
    }
}

From source file:Main.java

private static void close(Closeable closeable) {
    if (closeable != null) {
        try {//from  w ww  .  j  ava  2  s.  com
            closeable.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

From source file:Main.java

public static void close(Closeable closeable) {
    try {/*from www . j  av a  2 s  .c o m*/
        if (closeable != null) {
            closeable.close();
        }
    } catch (IOException e) {
        e.printStackTrace();
    }
}

From source file:Main.java

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

From source file:Main.java

public static void closeSilently(Closeable closeable) {
    if (closeable != null) {
        try {/* w  w  w .  ja v a 2s .  com*/
            closeable.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

From source file:Main.java

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

From source file:Main.java

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

From source file:Main.java

public static void closeQuickly(Closeable closeable) {
    if (closeable != null) {
        try {//from   w w w.j a v a 2  s.com
            closeable.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

}