title: convert image data in to byte code using base64 encodein android
body: <p>i am developing one app i am using upload image in sdcard getting from uri of image ,
  this convert in to byte array how can implemented i am new developer in android i am saving this image in byte array in database backend please forward some solution ....</p>
  
  <pre><code> startActivityForResult(new Intent(Intent.ACTION_PICK,android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI), 1);
              }
    public void onActivityResult(int requestCode,int resultCode,Intent data)  
   {
   super.onActivityResult(requestCode, resultCode, data);
   if (resultCode == Activity.RESULT_OK) 
   {
   Uri selectedImage = data.getData();
   Cursor cur = PhotoImage.this.managedQuery(selectedImage, null, null, null, null);
   if(cur.moveToFirst())
   {
   long Length = cur.getLong(cur.getColumnIndex(ImageColumns.SIZE));
   try{
   String Image=Base64.encodeBytes(selectedImage.getPath().getBytes());
   Log.v("check",Image);
   byte[] bytedata = new byte[(int) Length];
   FileOutputStream fos=new FileOutputStream(Img);
   fos.write(bytedata[0]);
   fos.close();
     }
   catch (Throwable th)
   {}
  </code></pre>
  
  <p>output is:</p>
  
  <p><code>12-30 13:00:24.619: VERBOSE/check(773): L2V4dGVybmFsL2ltYWdlcy9tZWRpYS8y</code></p>
  
  <p>this is the display output i think not converted in byte array please some solution ..</p>