Having trouble downloading and displaying inputstream in Android
<p>I'm trying to grab an inputStream from a secure website, convert it to a bitmap, and display it. The way I have my code set up (with the Logs displaying length of the byte array etc.) right now is because my error is </p>

<p>01-25 10:29:44.857: D/skia(13452): --- SkImageDecoder::Factory returned null</p>

<p>However that byte array length check responds:</p>

<p>01-25 10:29:44.834: W/bytes length(13452): 21844</p>

<p>I think this must mean that my byte array isn't being downloaded correctly, but I can't figure out how to check that/how I would fix it anyways.</p>

<p>I included my defaultHttpClient code because I want to make sure the way I'm dealing with security isn't somehow affecting the data.</p>

<pre><code>HttpPost post = new HttpPost("https://my.patlive.com//mailbox/messages/get.aspx?MsgID=" + messageId + "&amp;format=bmp");

List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;(3);

nameValuePairs.add(new BasicNameValuePair("username", username));
nameValuePairs.add(new BasicNameValuePair("password", password));

post.setEntity(new UrlEncodedFormEntity(nameValuePairs));

BitmapFactory.Options o = new BitmapFactory.Options();

o.inJustDecodeBounds = true;

InputStream is = httpclient.execute(post).getEntity().getContent();
byte[] bytes = readFully(is);

Log.w("bytes length", "" + bytes.length);

bmp = BitmapFactory.decodeByteArray(bytes, 0, bytes.length);
</code></pre>

<p>Thanks in advance, this has been stumping me for a few days.</p>
