Java tutorial
//package com.java2s; //License from project: Open Source License import android.util.Log; import java.io.Closeable; import java.io.IOException; public class Main { private static final String TAG = "StreamUtils"; /** * Closes the specified stream. * * @param stream The stream to close. */ public static void closeStream(final Closeable stream) { if (stream != null) { try { stream.close(); } catch (final IOException e) { Log.e(TAG, "Could not close stream " + e); } } } }