Java InputStream Close close(InputStream is)

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

Description

Close an InputStream

License

LGPL

Parameter

Parameter Description
is InputStream to close

Declaration

public static void close(InputStream is) 

Method Source Code

//package com.java2s;
/*//  w  w w. j av  a 2  s  . c  o m
 * JLib - Publicitas Java library v1.2.0.
 *
 * Copyright (c) 2005, 2006, 2007, 2008, 2009 Publicitas SA.
 * Licensed under LGPL (LGPL-LICENSE.txt) license.
 */

import java.io.InputStream;

import java.io.OutputStream;

public class Main {
    /**
     * Close an InputStream
     *
     * @param is InputStream to close
     */
    public static void close(InputStream is) {
        if (is != null) {
            try {
                is.close();
            } catch (Exception ex) {
            }
        }
    }

    /**
     * Close an OutputStream
     *
     * @param os OutputStream to close
     */
    public static void close(OutputStream os) {
        if (os != null) {
            try {
                os.close();
            } catch (Exception ex) {
            }
        }
    }
}

Related

  1. close(InputStream in, OutputStream out)
  2. close(InputStream input)
  3. close(InputStream inputStream)
  4. close(InputStream inputstream)
  5. close(InputStream inputStream)
  6. close(InputStream is)
  7. close(InputStream is)
  8. close(InputStream is)
  9. close(InputStream is)