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

private static void closeStream(Closeable stream) {
    if (stream != null) {
        try {//from w  ww . j a v  a 2 s  .c o  m
            stream.close();
        } catch (IOException e) {
            // Ignore
        }
    }
}

From source file:Main.java

static void closeQuietly(@Nullable Closeable c) {
    if (c != null) {
        try {//from w  w  w .j  a v a2 s. c o  m
            c.close();
        } catch (Throwable ignored) {
        }
    }
}

From source file:Main.java

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

From source file:Main.java

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

From source file:Main.java

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

From source file:Main.java

public static void closeStream(Closeable stream) {
    if (stream != null) {
        try {//from ww w.  j a v a2  s.c  o  m
            stream.close();
        } catch (IOException e) {

        }
    }
}

From source file:Main.java

public static void closeQuietly(Closeable c) {
    if (c != null) {
        try {/* w w w . j a  v  a2  s  .  co m*/
            c.close();
        } catch (Exception ex) {
        }
    }
}

From source file:Main.java

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

From source file:Main.java

public static void closeStream(@Nullable Closeable c) {
    if (c != null) {
        try {/*from  w w w .j a va2  s  . c  om*/
            c.close();
        } catch (IOException e) {
            // intentionally blank
        }
    }
}

From source file:Main.java

public static void close(Closeable res) {
    if (res == null)
        return;/* w  w w  . j  a  v  a  2  s.  c  o m*/
    try {
        res.close();
    } catch (IOException e) {
        // ignore
    }
}