base64编码和解码从java到c#的问题(Issue with base64 encoding and decoding from java to c#)
我已经使用Java将图像字节数组转换为base64encoded字符串
Base64.encodeBase64URLSafeString(baos.toByteArray());
并且我能够将其解码回字节数组并将图像保存在与原始文件相同的文件中。 但是当我将base64编码的字符串传递给ASP .NET Web服务时,尝试使用解码
Convert.FromBase64String(base64String);
我无法重现相同的图像。 请建议我正确解码的方法 - 在C#中java-编码的base64图像。
I have converted image byte array to base64encoded string in Java using
Base64.encodeBase64URLSafeString(baos.toByteArray());
and I am able to decode it back to byte array ans save the image in file which is same as original file . But when I pass the base64 encoded string to the ASP .NET web service , and try to decode using
Convert.FromBase64String(base64String);
I am unable to reproduce the same image . Please suggest me the correct way to decode - an encoded base64 image in java- in C#.
原文:
更新时间:2022-11-28 15:11
相关问答
更多-
form_for从many_to_many连接表中保存/删除(form_for to save/delete from many_to_many connecting table)[2022-05-13]
如果你正在使用check_box,我认为remote: true是你最好的选择,而是你需要将一个事件附加到你的复选框,一旦被检查就会触发。 但是,如果你对CSS或设计框架很好,你可以设置一个按钮/锚标签的样式,使其看起来像一个复选框,并将remote: true附加到这些,但它也带来了一层复杂性,因为你需要更换检查时的URL。 因此,最后,将eventlistener附加到您的复选框可能是最好的方法。 之前的SO问题对于如何监听复选框上的点击有一点描述 如果我能够提供帮助或您可能需要的其他指导,请告诉我。 ... -
由于您使用的group_artists不仅仅是一个简单的连接表,因此您需要使用嵌套属性来创建包含元数据的行: class Group < ApplicationRecord has_many :group_artists has_many :singers, -> { where role: "Singer" }, class_name: "GroupArtist" has_many :guitarists, -> { where role: "Guitarist" }, class_name: ...
-
第一个问题: 添加到文章#显示 def show @comment = Comment.new end First question: Add into Article#Show def show @comment = Comment.new end
-
它不起作用,因为您的选择@listing于@listing对象。 尝试: <%= f.collection_select(:category_id, Category.all, :id, :name) %> 要解决@ddubs的评论建议用Rails表单助手替换select标签以及保留自定义HTML数据属性: <%= f.collection_select(:category_ids, Category.all, :id, :name, {}, class: "selectpicker", title: " ...
-
我从我的/views/application.erb.html文件中删除了<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %> ,现在功能似乎起作用。 I deleted <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %> from my /views/application.erb.html fil ...
-
您收到此错误,因为您的路由文件没有为admins / newbody定义POST方法。 看起来您的routes.rb文件应该格式如下: get 'admin' => 'admins#home' resources :admins do collection do post 'newbody' get 'committees' end end 这有一些值得注意的变化。 首先,这消除了GET'admins / newbody'的路线; 因为你正在那条路线上创建一 ...
-
好的,我想出了这头野兽。 当我回答时,坚持我。 阿贾克斯是你最好的朋友。 所以:首先,将new (plus)方法的link_to更改为一个按钮:
相关文章
更多- JAVA实现BASE64编码和解码图片文件
- Base64加密解密
- C#开发微信公众化平台
- robbe+base64+Mysql简易有效的php全文索引实现
- C#开发微信公众平台-就这么简单(附Demo)
- 用C#捕捉键盘和鼠标
- C#开发微信公众平台-就这么简单(附Demo)
- 基于C#的UDP协议的同步实现
- android遥控器:控制电脑上的暴风影音播放(C#作为服务端)
- android遥控器:控制电脑上的暴风影音播放(C#作为服务端)
最新问答
更多- 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
- 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
- OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
- 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
- codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
- 在计算机拍照在哪里进入
- 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
- No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
- 单页应用程序:页面重新加载(Single Page Application: page reload)
- 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
- System.StackOverflow错误(System.StackOverflow error)
- KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
- 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
- android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
- TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
- 企业安全培训的各项内容
- 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
- C#类名中允许哪些字符?(What characters are allowed in C# class name?)
- NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
- 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
- 将多个行和可变行移动到列(moving multiple and variable rows to columns)
- 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
- 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
- Angular $资源不会改变方法(Angular $resource doesn't change method)
- 在Angular 5中不是一个函数(is not a function in Angular 5)
- 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
- 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
- 常见的python rpc和cli接口(Common python rpc and cli interface)
- Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
- 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)