Java tutorial
//package com.java2s; import java.io.Closeable; import java.io.IOException; public class Main { private static void close(Closeable in, Closeable out) { try { if (in != null) in.close(); if (out != null) out.close(); } catch (IOException e) { e.printStackTrace(); } } }