Java Stream Close closeStream(Closeable... streams)

Here you can find the source of closeStream(Closeable... streams)

Description

close Stream

License

Apache License

Declaration

public static void closeStream(Closeable... streams) 

Method Source Code


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

import java.io.Closeable;

public class Main {
    public static void closeStream(Closeable... streams) {
        if (streams == null)
            return;
        for (Closeable stream : streams) {
            CloseOneStream(stream);/* w  w  w.j a  va2  s  . co m*/
        }
    }

    private static void CloseOneStream(Closeable stream) {
        if (stream != null) {
            try {
                stream.close();
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
}

Related

  1. closeStream(Closeable closeable)
  2. closeStream(Closeable closeable)
  3. closeStream(Closeable stream)
  4. closeStream(Closeable stream)
  5. closeStream(Closeable... closeable)
  6. closeStream(FileInputStream in)
  7. closeStream(final Closeable stream)
  8. closeStream(final InputStream in)
  9. closeStream(final InputStream stream)