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 closeQuiltly(Closeable closeable) {
    if (null != closeable) {
        try {/*from w ww .  j  av a2s. c o  m*/
            closeable.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

From source file:Main.java

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

From source file:Main.java

public static void silentlyCloseCloseable(@Nullable Closeable clos) {
    if (clos != null) {
        try {//from   w  ww. j a v a  2  s  .  co m
            clos.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

From source file:Main.java

private static void close(Closeable in, Closeable out) {
    try {//from w  w w . j a va2 s. c  o  m
        if (in != null)
            in.close();
        if (out != null)
            out.close();
    } catch (IOException e) {
        e.printStackTrace();
    }
}

From source file:Main.java

public static void closeAll(Closeable... closeables) {
    if (closeables != null) {
        for (Closeable c : closeables) {
            try {
                c.close();
            } catch (Exception e) {
                // empty
            }//ww w .j a  v  a 2  s.  c  om
        }
    }
}

From source file:Main.java

public static void closeSilently(Closeable closeable) {
    if (closeable != null) {
        try {/*  w  w w . j  ava  2  s  . co  m*/
            closeable.close();
        } catch (IOException ignored) {

        }
    }
}

From source file:com.eatnumber1.util.io.IOUtils.java

public static void closeQuietly(@NotNull Closeable closeable) {
    try {//from  ww w. j av  a  2  s .  co m
        closeable.close();
    } catch (IOException e) {
        // Ignore
    }
}

From source file:Main.java

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

From source file:Main.java

public static void closeQuietly(Closeable closeable) {
    try {/*ww w .ja v a  2  s.c o  m*/
        if (closeable != null) {
            closeable.close();
        }
    } catch (IOException var2) {
        //log.d(var2.toString());
    }

}

From source file:Main.java

/**
 *
 *///from w  w w . j av  a  2  s  .  c om
private static void closeStream(Closeable stream) {

    if (null != stream) {

        try {
            stream.close();
        } catch (IOException e) {
            android.util.Log.e("IO", "closeStream:Could not close stream!", e);
        }
    }
}