Java tutorial
//package com.java2s; import java.io.Flushable; import java.io.IOException; public class Main { public static void flushAll(Flushable... flushes) { if (flushes.length <= 0) return; for (Flushable flush : flushes) { if (flush == null) continue; try { flush.flush(); } catch (IOException e) { e.printStackTrace(); } } } }