private static void save(Bitmap src,String fileName,Bitmap.CompressFormat format,int quality) throws ImageSaveException {
  FileOutputStream outputStream=null;
  try {
    outputStream=new FileOutputStream(fileName);
    src.compress(format,quality,outputStream);
    outputStream.close();
  }
 catch (  IOException e) {
    throw new ImageSaveException(e);
  }
 finally {
    if (outputStream != null) {
      try {
        outputStream.close();
      }
 catch (      IOException e1) {
        e1.printStackTrace();
      }
    }
  }
}

private static void save ( Bitmap src , String fileName , Bitmap . CompressFormat format , int quality ) throws ImageSaveException { FileOutputStream outputStream = null ; try { outputStream = new FileOutputStream ( fileName ) ; src . compress ( format , quality , outputStream ) ; outputStream . close ( ) ; } catch ( IOException e ) { throw new ImageSaveException ( e ) ; } finally { if ( outputStream != null ) { try { outputStream . close ( ) ; } catch ( IOException e1 ) { e1 . printStackTrace ( ) ; } } } }
saving image to file
