Java Utililty Methods Stream Close

List of utility methods to do Stream Close

Description

The list of methods to do Stream Close are organized into topic(s).

Method

voidcloseInputStream(InputStream inp)
close Input Stream
if (inp != null)
    try {
        inp.close();
    } catch (IOException e) {
voidcloseInputStream(InputStream inputStream)
close Input Stream
inputStream.close();
voidcloseInputStream(InputStream inputStream)
close Input Stream
try {
    if (inputStream != null) {
        inputStream.close();
} catch (IOException e) {
    throw new RuntimeException("Unable to close file input stream.", e);
voidcloseInputStream(InputStream stream)
close Input Stream
if (stream != null) {
    try {
        stream.close();
    } catch (IOException ex) {
        ex.printStackTrace();
    } catch (Throwable ex) {
        ex.printStackTrace();
voidcloseJMXConnection()
close JMX Connection
if (jmxc != null) {
    try {
        jmxc.close();
        jmxc = null;
    } catch (IOException e) {
        e.printStackTrace();
connectNumber--;
voidcloseKeyMap(BufferedReader in)
close Key Map
if (in != null)
    in.close();
voidcloseLog()
close Log
try {
    if (fw != null) {
        fw.close();
} catch (IOException e) {
    e.printStackTrace();
System.err.println("NwtUtil.closeLog");
...
voidcloseLog()
Close the PrintWriter on the log file, if it's open
if (mLogPrintWriter != null)
    mLogPrintWriter.close();
voidcloseLog()
close Log
if (logOut != null)
    logOut.close();
logOut = null;
voidcloseNoException(Closeable... closeables)
close No Exception
if (closeables != null) {
    for (Closeable cl : closeables) {
        try {
            if (cl instanceof Flushable) {
                flushNoException((Flushable) cl);
            cl.close();
        } catch (Exception ioe) {
...