Low performance when converting Blob to Bitmap

Asked

Viewed 26 times

1

I’m using the following code :

BitmapFactory.Options options = new BitmapFactory.Options();
            options.inSampleSize = 4;
            bitmap = BitmapFactory.decodeStream(blob.getBinaryStream(), null, options);

The problem is that it takes longer than downloading the data itself! Is there any faster way to convert , or at least a 'Blobview'' ?

1 answer

0

I don’t know if it’s faster, but I’ve always used this form:

 byte[] byteArray = cursor.getBlob(columIndex);
 Bitmap bm = BitmapFactory.decodeByteArray(byteArray, 0 ,byteArray.length);

And I never had a problem with performance.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.