Closing a stream
by ventrix on Dec.10, 2008, under android, j2ee, j2me, j2se, java
/**
* Closes the specified stream.
*
* @param stream The stream to close.
*/
private static void closeStream(Closeable stream) {
if (stream != null) {
try {
stream.close();
} catch (IOException e) {
android.util.Log.e("IO", "Could not close stream", e);
}
}
Use it like: closeStream(in);
No comments for this entry yet...