title: ByteArrayOutputStream to a FileBody
body: <p>I have a Uri to an image that was either taken or selected from the Gallery that I want to load up and compress as a JPEG with 75% quality.  I believe I have achieved that with the following code:</p>
  
  <pre><code>ByteArrayOutputStream bos = new ByteArrayOutputStream();
  Bitmap bm = BitmapFactory.decodeFile(imageUri.getPath());
  bm.compress(CompressFormat.JPEG, 60, bos);
  </code></pre>
  
  <p>Not that I have tucked it into a <code>ByteArrayOutputStream</code> called <code>bos</code> I need to then add it to a <code>MultipartEntity</code> in order to <code>HTTP POST</code> it to a website.  <strong>What I can't figure out is how to convert the ByteArrayOutputStream to a FileBody.</strong></p>