相当于Java Convert.FromBase64String方法 [英] Java equivalent of Convert.FromBase64String Method

查看:1874
本文介绍了相当于Java Convert.FromBase64String方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一些Java相当于 Convert.FromBase64String

Is there some Java equivalent of Convert.FromBase64String which

指定的字符串,它连接codeS二进制数据为基础,64位转换,为等效的8位无符号整数数组。

Converts the specified string, which encodes binary data as base-64 digits, to an equivalent 8-bit unsigned integer array.

我曾尝试:

  • com.lutris.util.Convert. but it gives me signed values
  • encode to string then convert to unsigned bytes, but then it gives me completely wrong output (wrong length and data).

将必须对建议表示感谢!

Will be grateful for any suggestions!

推荐答案

在一般情况下,有很好的机会,如果标准Java库没有你需要的东西,Apache的共享框架一样。在这种情况下,你要在 <一个href=\"http://commons.apache.org/$c$cc/apidocs/org/apache/commons/$c$cc/binary/Base64.html#de$c$cBase64%28java.lang.String%29\"相对=nofollow> 德codeBase64 公地。codec.binary.Base64

In general, chances are good that if the standard Java libraries don't have something you need, the Apache Commons framework does. In this case, you want the decodeBase64 method from commons.codec.binary.Base64.

这篇关于相当于Java Convert.FromBase64String方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆