Android Stream Close closeStreams(List streams)

Here you can find the source of closeStreams(List streams)

Description

close Streams

Declaration

public static void closeStreams(List<Closeable> streams) 

Method Source Code

//package com.java2s;

import java.io.Closeable;

import java.io.IOException;

import java.util.List;

public class Main {
    public static void closeStreams(List<Closeable> streams) {
        if (streams == null)
            return;

        for (Closeable str : streams) {
            closeQuitely(str);/*from ww  w .j av a2 s.c  o m*/
        }
    }

    public static void closeQuitely(Closeable c) {
        if (c == null)
            return;

        try {
            c.close();
        } catch (IOException e) {
            // ignore
        }
    }
}

Related

  1. closeOutputStream(OutputStream os)
  2. closeQuietly(Closeable closeable)
  3. closeQuitely(Closeable c)
  4. closeStream(Closeable stream)
  5. closeStream(Closeable stream)
  6. safeClose(OutputStream os)