There are basically two options:
- The buffer is read from the BLOB wrapper in an InputStream, so you will have an InputStream that points to the BLOB data.
- Saving BLOB data in a temporary file opens it as FileInputStream - so at the end you will again get the image data stream
in both cases, you can easily convert an InputStream to bitmap data as follows:
InputStream is; //stream pointing to your blob or file //... imageView=new ImageView(this); imageView.setScaleType(ImageView.ScaleType.CENTER_INSIDE); imageView.setAdjustViewBounds(true); imageView.setImageBitmap(BitmapFactory.decodeStream(is));
source share