Ok i've googled this topic found couple not really examples but ways to accomplish task similar to mine. So long story told short; i am trying to send an image from database with json string through java webservice, i am comparing byte arrays on each side, they are different, therefore image is not shown.
This is my (restful)webservice code for encoding image with base64
dto.setArti_image(new String(Base64.encode(rs.getBlob("arti_image"))));
result in byte[]
[B@270d42dc
And this is my code for decoding
byte[] image= Base64.decode(item.getArti_image(),Base64.NO_WRAP);
holder.imageItem.setImageBitmap(BitmapFactory.decodeByteArray(image, 0, image.length) );
result in byte
[B@41079340
Is this correct way of doing it or is there any more reliable way?
[B@270d42dc
means[
Array,B
=>byte
,@270d42dc
the object's hashcode. This has nothing to do with it's content.Arrays.toString
can be used to print the entire content of an array. – zapl Oct 29 '14 at 18:14