I stuck in out of memory. I’m trying to load an image with byte array but what ever i’ve done it wouldn’t work. I get bitmap decoder error I guess. These are all code :
String password = prefs.getString("BookKey", "");
BufferedInputStream buf = new BufferedInputStream(new FileInputStream(file));
buf.read(bytes, 0, bytes.length);
buf.close();
byte[] bytesdecrpy = decrypt(bytes, password);
BitmapFactory.Options options = new BitmapFactory.Options();
options.inDither = true;
options.inJustDecodeBounds = false;
options.inPreferredConfig = Bitmap.Config.ARGB_8888;
options.inTempStorage = new byte[32 * 1024];
options.inBitmap = BitmapFactory.decodeByteArray(bytesdecrpy, 0,
bytesdecrpy.length, options);
bm = Bitmap.createBitmap(options.outWidth,
options.outHeight, Bitmap.Config.ARGB_8888);
imageView.setImage(ImageSource.bitmap(bm));
I read as a byte array my encrypt png from device file but i having problem that when i create bitmap for bitmap variable. I still couldn’t run as well for 2 days. If anyone can help me to solve this problem it would be great. Thank you.
EDIT
I've tried only decode my byte array to bitmap like this but problem never changed i've started get problem in decode then
bm = BitmapFactory.decodeByteArray(bytesdecrpy, 0,
bytesdecrpy.length, options);