Java Stream Close closeQuietly(InputStream is)

Here you can find the source of closeQuietly(InputStream is)

Description

Close a possibly-null InputStream and swallow any resulting IOException.

License

Apache License

Declaration

static void closeQuietly(InputStream is) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.io.InputStream;
import java.io.IOException;

public class Main {
    /** Close a possibly-null InputStream and swallow any resulting IOException. */
    static void closeQuietly(InputStream is) {
        if (is == null) {
            return;
        }//from w  ww.jav a 2 s  .co m
        try {
            is.close();
        } catch (IOException ioe) {
            // swallow exception
        }
    }
}

Related

  1. closeQuietly(InputStream input)
  2. closeQuietly(InputStream input)
  3. closeQuietly(InputStream input)
  4. closeQuietly(InputStream input)
  5. closeQuietly(InputStream inputstream)
  6. closeQuietly(InputStream is)
  7. closeQuietly(InputStream is)
  8. closeQuietly(InputStream is)
  9. closeQuietly(InputStream is)