public static void closeOutputStream(OutputStream stream,String tag){
  if (stream != null) {
    try {
      stream.close();
    }
 catch (    IOException e) {
      Log.e(tag,"Exception occured when closing ByteArrayOutputStream." + e);
    }
  }
}

public static void closeOutputStream ( OutputStream stream , String tag ) { if ( stream != null ) { try { stream . close ( ) ; } catch ( IOException e ) { Log . e ( tag , "Exception occured when closing ByteArrayOutputStream." + e ) ; } } }
close a bytearrayoutputstream passed in .
