Java InputStream Close forceClosed(InputStream stream)

Here you can find the source of forceClosed(InputStream stream)

Description

force Closed

License

Open Source License

Declaration

public static void forceClosed(InputStream stream) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

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

public class Main {
    public static void forceClosed(InputStream stream) {
        if (stream != null) {
            try {
                stream.close();/*from  ww  w. j  a v a2  s.co  m*/
            } catch (IOException e) {
            }
        }
    }

    public static void forceClosed(OutputStream stream) {
        if (stream != null) {
            try {
                stream.close();
            } catch (IOException e) {
            }
        }
    }
}

Related

  1. close(InputStream is)
  2. close(InputStream is)
  3. close(InputStream is, boolean success)
  4. close(InputStream is, OutputStream os)
  5. forceClose(Closeable stream)