1

I've been searching a lot but i couldn't find an answer for this simple question.

I would like to implement one of the following functions:

public Blob getBlob(Byte[] imageByteArray){

}

public Blob getBlob(File imageFile){

}

please note that these functions are being called from the android client. thanks!

Urbanleg
  • 6,252
  • 16
  • 76
  • 139
  • Here's a [question](http://stackoverflow.com/questions/2714700/byte-to-image-android) similar to yours that has been answered... – TweakBox Sep 18 '16 at 12:22

1 Answers1

-1
//you bitmap image first get
Bitmap bitmap = BitmapFactory.decodeFile("/path/images/image.jpg");
//take on bytearrayoutputStream to convert into blolb  so here is you blob
ByteArrayOutputStream blob = new ByteArrayOutputStream();
bitmap.compress(CompressFormat.PNG, 0 "ignore png", blob);
byte[] bitmapdata = blob.toByteArray();
QuokMoon
  • 4,387
  • 4
  • 26
  • 50