public static boolean writeToFile ( Bitmap bmp , String fileName ) { if ( bmp == null || StringUtils . isNullOrEmpty ( fileName ) ) return false ; FileOutputStream fos = null ; try { fos = new FileOutputStream ( fileName ) ; bmp . compress ( CompressFormat . PNG , 100 , fos ) ; fos . flush ( ) ; fos . close ( ) ; } catch ( Exception e ) { return false ; } finally { if ( fos != null ) { try { fos . close ( ) ; } catch ( IOException e ) { // TODO Auto-generated catch block e . printStackTrace ( ) ; } } } return true ; }
write bitmap to file .