Java Stream Close close(Closeable stream)

Here you can find the source of close(Closeable stream)

Description

close

License

Apache License

Declaration

public static void close(Closeable stream) 

Method Source Code

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

import java.io.Closeable;

import java.io.IOException;

public class Main {
    public static void close(Closeable stream) {
        if (stream == null) {
            return;
        }// w w  w  .jav a2s.  c  o m
        try {
            stream.close();
        } catch (IOException ioe) {
        }
    }

    public static void close(Closeable... streams) {
        if ((streams == null) || (streams.length == 0)) {
            return;
        }
        for (Closeable c : streams) {
            try {
                if (c != null) {
                    c.close();
                }
            } catch (IOException ioe) {
            }
        }
    }
}

Related

  1. close(Closeable io, Logger logger)
  2. close(Closeable resource)
  3. close(Closeable resource)
  4. close(Closeable resource)
  5. close(Closeable resource, File file)
  6. close(Closeable... streams)
  7. close(Collection inCloseables)
  8. close(DataOutputStream out)
  9. close(File file)