Java tutorial
//package com.java2s; //License from project: Open Source License import java.io.Closeable; import java.io.IOException; import android.util.Log; public class Main { /** * Convenience function - closes the given stream (can be any Closable), catching and logging exceptions * @param stream a Closeable to close */ static public void close(final Closeable stream) { if (stream != null) { try { stream.close(); } catch (IOException e) { Log.e("SavingHelper", "Problem closing", e); } } } }