相当于Java Convert.FromBase64String方法 [英] Java equivalent of Convert.FromBase64String Method
问题描述
有一些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。,但它给了我签署值
- EN code字符串那么的转换为无符号字节,但它给了我完全错误输出(错误的长度和数据)。
- 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屋!