Java tutorial
//package com.java2s; //License from project: Apache License import android.util.Log; import java.io.IOException; import java.io.InputStream; public class Main { /** * Close a InputStream passed in. * * @param stream - InputStream to be closed. */ public static void closeInputStream(InputStream stream, String tag) { if (stream != null) { try { stream.close(); } catch (IOException e) { Log.e(tag, "Exception occured when closing InputStream." + e); } } } }