星空网 > 软件开发 > ASP.net

用json在java和C#之间传递base64的问题。。。

记录下。。唉。。。。

java代码:

导入这个commons-codec-1.8.jar (下载链接: http://files.cnblogs.com/files/gaocong/jar%E5%8C%85.rar)
java后台方法InputStream in = null; byte[] data = null; //读取图片字节数组 try { in = new FileInputStream(imgFilePath); data = new byte[in.available()]; in.read(data); in.close(); } catch (IOException e) { e.printStackTrace(); } //对字节数组Base64编码 return new String(Base64.encodeBase64(data));//返回Base64编码过的字节数组字符串

然后在c#中解码

 //字符串转流        byte[] bt = Convert.FromBase64String(m_l.BinaryImg);

 




原标题:用json在java和C#之间传递base64的问题。。。

关键词:C#

C#
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

OZON电商平台注册的必要性资料:https://www.kjdsnews.com/a/772435.html
速卖通店铺流量扶持?一文看懂中国好卖家的申请条件!:https://www.kjdsnews.com/a/772436.html
如何免费使用谷歌关键词规划师挖掘关键词?:https://www.kjdsnews.com/a/772437.html
香港税务局能核查到跨境电商企业是否有隐匿收入吗?:https://www.kjdsnews.com/a/772438.html
你值得关注的美国市场四大趋势:https://www.kjdsnews.com/a/772439.html
shopee 本土店铺注册及登录:https://www.kjdsnews.com/a/772440.html
长治婚庆女司仪和主持人:https://www.vstour.cn/a/366176.html
北京丰台区水上乐园哪家好玩?:https://www.vstour.cn/a/366177.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流