title: Android, parse, storing image file from camera
body: <p>I am trying to store an image file in Parse.com for use as a profile photo.</p>
  
  <p>I have a function used to capture the image:</p>
  
  <pre><code>private void captureImage() {
              Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
  
              fileUri = getOutputMediaFileUri(MEDIA_TYPE_IMAGE);
  
              intent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri);
  
  
  
              // start the image capture Intent
              startActivityForResult(intent, CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE);
  
          }
  </code></pre>
  
  <p>According to Parse <a href="https://parse.com/docs/android_guide#files" rel="nofollow">documentation</a>, I need to have the data in byte[] form and then create a ParseFile with it.  So, I have this:</p>
  
  <pre><code>            byte[] data = fileUri.getBytes();
  
              // Save image to Parse
              photoFile = new ParseFile("profile_photo.jpg", data);
  </code></pre>
  
  <p>I am getting an error: cannot resolve method getBytes.  Not entirely sure if I am missing an import, or if I am approaching this the entirely wrong way.  How can I convert a captured image file to byte form so I can create a ParseFile?</p>