How to convert String to Image (Java)

I have an issue about my Application in detail. - I have a java servlet receive data from mms gateway (MM7 protocol) I get inputstream (image content , message content ) convert to string ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); //String orgin = new String(byteArrayOutputStream.toByteArray(),"UTF-8"); String orgin = Streams.asString(request.getInputStream(), "ISO-8859-1"); Then I substring orgin for image content and convert to base64 and save to image file but string that I convert to base64 can not save to image because this error not a jpeg file I print out string base64 does not start with /9j that mean not jpg format please suggest or give an example for me Best reqard lieang noob noob sorry for my english :)

以上就是How to convert String to Image (Java)的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏