I have a database with some images inside, saved as BLOB. I didn't have any problem with the database until now, I try to retrieve the BLOB as I would do with any other data but it's not working:
Cursor c = mDb.query(" ... ");
c.moveToFirst();
ByteArrayInputStream inputStream = new ByteArrayInputStream(c.getBlob(0));
Bitmap b = BitmapFactory.decodeStream(inputStream);
The problem is that I get an exception when the program is trying to get the information of "c.getBlob(0)". It's also not working for "byte[] b = c.getBlob(0)".
Possible reasons:
- The file is too large? (1.2Mb)
- I have to do something else to configure the kind of BLOB that it is?
Thanks!
SOLVED: when I tried accidentally with other file it worked! Then I realized that the file was smaller (less than 1Mb), so the problem seems to be the size.
Now my question is, can I configure it to make the BLOB support large files?
Thanks!