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

voidcloseQuietly(InputStream input)
Closes InputStream while catching any exceptions
try {
    input.close();
} catch (IOException ex) {
voidcloseQuietly(InputStream input)
Unconditionally close an InputStream.
try {
    if (input != null) {
        input.close();
} catch (IOException ioe) {
voidcloseQuietly(InputStream input)
close Quietly
if (input == null) {
    return;
try {
    input.close();
} catch (IOException ioe) {
voidcloseQuietly(InputStream input)
close Quietly
closeQuietly((Closeable) input);
voidcloseQuietly(InputStream input)
close Quietly
closeQuietly((Closeable) input);
voidcloseQuietly(InputStream inputstream)
Closes an input stream quietly (i.e.
try {
    close(inputstream);
} catch (IOException e) {
voidcloseQuietly(InputStream is)
Close a possibly-null InputStream and swallow any resulting IOException.
if (is == null) {
    return;
try {
    is.close();
} catch (IOException ioe) {
voidcloseQuietly(InputStream is)
Performs the same function as the commons io version but also performs logging of streams which threw an exception when trying to close them and logs them at error level
close(is);
voidcloseQuietly(InputStream is)
close Quietly
try {
    if (is != null)
        is.close();
} catch (IOException ignored) {
voidcloseQuietly(InputStream is)
close Quietly
try {
    if (is != null) {
        is.close();
} catch (Exception e) {
    e.printStackTrace();