Java Stream Close closeQuietly(ObjectInput objectInput)

Here you can find the source of closeQuietly(ObjectInput objectInput)

Description

Close the specified object input, ignoring any exceptions.

License

Apache License

Declaration

public static void closeQuietly(ObjectInput objectInput) 

Method Source Code

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

import java.io.InputStream;

import java.io.ObjectInput;

import java.io.OutputStream;

import java.io.Reader;
import java.io.Writer;

public class Main {
    /**/* ww  w. j a  v  a  2 s .c  om*/
     * Close the specified input stream, ignoring any exceptions.
     */
    public static void closeQuietly(InputStream inputStream) {
        try {
            inputStream.close();
        } catch (final Exception e) {
            // Ignored
        }
    }

    /**
     * Close the specified writer, ignoring any exceptions.
     */
    public static void closeQuietly(Writer writer) {
        try {
            writer.close();
        } catch (final Exception e) {
            // Ignored
        }
    }

    /**
     * Close the specified reader, ignoring any exceptions.
     */
    public static void closeQuietly(Reader reader) {
        try {
            reader.close();
        } catch (final Exception e) {
            // Ignored
        }
    }

    /**
     * Close the specified object input, ignoring any exceptions.
     */
    public static void closeQuietly(ObjectInput objectInput) {
        try {
            objectInput.close();
        } catch (final Exception e) {
            // Ignored
        }
    }

    /**
     * Close the specified output stream, ignoring any exceptions.
     */
    public static void closeQuietly(OutputStream outputStream) {
        try {
            outputStream.close();
        } catch (final Exception e) {
            // Ignored
        }
    }
}

Related

  1. closeQuietly(Object input)
  2. closeQuietly(Object obj)
  3. closeQuietly(Object object)
  4. closeQuietly(Object object)
  5. closeQuietly(Object... o)
  6. closeQuietly(ObjectInput... objectInputs)
  7. closeQuietly(Reader input)
  8. closeQuietly(Reader r)
  9. closeQuietly(Reader reader)