I've downsampled an image and received a byte array from it. I'm now trying to create a Bitmap using this byte array using the following two methods. Here's my code:
InputStream is = new ByteArrayInputStream(output);
Bitmap DSimg = BitmapFactory.decodeStream(is);
Bitmap DSimage = BitmapFactory.decodeByteArray(output, 0, output.length);
In this case output
is a byte array where byte[] output = [117, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
(that's 16 total values).
I've tried using InputStream and decodeByteArray to return an image but I'm getting null for both Bitmaps, and logcat hasn't displayed any errors. Is my array that I'm passing in wrong? Or, to be more blunt, what's wrong with my code?