title: To convert the file into byte array
body: <p>I am creating one directory i.e file and storing the bitmap images into that file,now how to convert it into byte array</p>
  
  <pre><code>File myDir = new File(root + "/saved_images");      
                  myDir.mkdirs();
                  Random generator = new Random();
                  int n = 10000;
                  n = generator.nextInt(n);
                  String fname = "Image-"+ n +".jpg";
                  File file = new File (myDir, fname);
  
                  if (file.exists ()) file.delete (); 
                  try {
                      FileOutputStream out = new FileOutputStream(file);
  
                      bmp.compress(Bitmap.CompressFormat.JPEG, 90, out);
  
                      out.flush();
                      out.close();
                  } catch (Exception e) {
                      e.printStackTrace();
  
                  }
  </code></pre>