Java Stream Close closeStream(InputStream ins)

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

Description

close Stream

License

Apache License

Declaration

public static void closeStream(InputStream ins) 

Method Source Code


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

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

public class Main {
    public static void closeStream(Writer writer) {
        try {/*w ww  .  j  av a 2  s .c  o  m*/
            writer.close();
        } catch (IOException e) {
        }
    }

    public static void closeStream(Reader reader) {
        try {
            reader.close();
        } catch (IOException e) {
        }
    }

    public static void closeStream(InputStream ins) {
        try {
            ins.close();
        } catch (IOException e) {
        }
    }

    public static void closeStream(OutputStream out) {
        try {
            out.close();
        } catch (IOException e) {
        }
    }
}

Related

  1. closeStream(final java.io.Closeable stream)
  2. closeStream(final Object stream)
  3. closeStream(InputStream in)
  4. closeStream(InputStream in)
  5. closeStream(InputStream inputStream)
  6. closeStream(Object oin)
  7. closeStream(OutputStream os)
  8. closeStreamIgnoreExpection(InputStream stream)
  9. closeStreamQuietly(final Closeable closeable)