title: Decode byte array to bitmap that has been compressed in Java
body: <p>I am compressing a bitmap in the following way</p>
  
  <pre><code>Bitmap bmpSig = getMyBitMap();
  int size = bmpSig.getWidth() * bmpSig.getHeight();
  ByteArrayOutputStream out = new ByteArrayOutputStream(size);
  bmpSig.compress(Bitmap.CompressFormat.JPEG, 100, out);   
  byte[] bytSig = out.toByteArray();
  </code></pre>
  
  <p>I am then trying to display the image in an Android ImageView from the byte array. When I do this I get an image that is completely black image.</p>
  
  <pre><code>ImageView myImg = (ImageView) findViewById(R.id.img_view);
  myImg.setImageBitmap(BitmapFactory.decodeByteArray(bytSig, 0, bytSig.length));
  </code></pre>
  
  <p>I'm assuming it's because I am missing a step before BitmapFactory.decodeByteArray() to reverse the jpeg compression. Or have I misunderstood how the compression works?</p>