Java tutorial
//package com.java2s; /* * The MIT License (MIT) * Copyright (c) 2014 longkai * The software shall be used for good, not evil. */ import java.io.Closeable; import java.io.IOException; public class Main { public static void closeIO(Closeable... closeables) { for (Closeable closeable : closeables) { if (closeable != null) { try { closeable.close(); } catch (IOException e) { // no-op } } } } }