Java Stream Close closeStream(InputStream in)

Here you can find the source of closeStream(InputStream in)

Description

close Stream

License

Open Source License

Parameter

Parameter Description
in a parameter

Declaration

public static boolean closeStream(InputStream in) 

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 {
    /**/*  ww  w . j  a va 2  s .  c  o  m*/
     * 
     * 
     * @param in
     * 
     * @return
     */
    public static boolean closeStream(InputStream in) {
        try {
            if (in != null) {
                in.close();
            }

            return true;
        } catch (IOException ioe) {
            return false;
        }
    }

    /**
     * 
     * 
     * @param out
     * 
     * @return
     */
    public static boolean closeStream(OutputStream out) {
        try {
            if (out != null) {
                out.close();
            }

            return true;
        } catch (IOException ioe) {
            return false;
        }
    }
}

Related

  1. closeStream(final Closeable stream)
  2. closeStream(final InputStream in)
  3. closeStream(final InputStream stream)
  4. closeStream(final java.io.Closeable stream)
  5. closeStream(final Object stream)
  6. closeStream(InputStream in)
  7. closeStream(InputStream inputStream)
  8. closeStream(InputStream ins)
  9. closeStream(Object oin)