How To Download Base64 Data Partly From Web Server And Decode Partly From Encoded Data?
Solution 1:
I am not sure, whether I understand your problem, but I will try:
Whenever you decode base64 image sent in 1 go it works, but when you receive parts of it in few instalments, decode fails. If that is the case, you have to be clever about gluing your received parts together. Please remember that each character of Base64 encoding represents 7 bits of information not 8. You cannot simply append received characters into one big file, array or string. Does your server use base64 padding when sending chunks?
Please remember that Android does not support TIFF natively. Try using PNG or JPEG.
It would make much more sense, if the server sent it as binary data and you opened the stream on the connection and decoded the image from that stream on the fly using
BitmapFactory
class
Post a Comment for "How To Download Base64 Data Partly From Web Server And Decode Partly From Encoded Data?"