Java Stream Close close(ObjectInput in)

Here you can find the source of close(ObjectInput in)

Description

close

License

Open Source License

Declaration

public static void close(ObjectInput in) 

Method Source Code

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

import java.io.InputStream;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import java.io.OutputStream;

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

public class Main {

    public static void close(Reader reader) {

        try {/*w  w w .j av  a  2  s  . co  m*/
            if (reader != null) {
                reader.close();
            }
        } catch (Exception ex) {
            // ex.printStackTrace();
        }
    }

    public static void close(Writer writer) {
        try {
            if (writer != null) {
                writer.close();
            }
        } catch (Exception ex) {
            // ex.printStackTrace();
        }
    }

    public static void close(InputStream in) {
        try {
            if (in != null) {
                in.close();
            }
        } catch (Exception ex) {
            // ex.printStackTrace();
        }
    }

    public static void close(OutputStream out) {

        try {
            if (out != null) {
                out.close();
            }
        } catch (Exception ex) {
            // ex.printStackTrace();
        }
    }

    public static void close(ObjectInput in) {

        try {
            if (in != null) {
                in.close();
            }
        } catch (Exception ex) {
            // ex.printStackTrace();
        }
    }

    public static void close(ObjectOutput out) {

        try {
            if (out != null) {
                out.close();
            }
        } catch (Exception ex) {
            // ex.printStackTrace();
        }
    }
}

Related

  1. close(Iterator iterator)
  2. close(java.io.Closeable in)
  3. close(JMXConnector connector)
  4. close(Object obj)
  5. close(Object resource)
  6. close(OutputStream in)
  7. close(OutputStream os)
  8. close(OutputStream s)
  9. close(PrintStream writer)