Decode Base64 data in Java(在 Java 中解码 Base64 数据)
问题描述
我有一张经过 Base64 编码的图像.在 Java 中解码的最佳方法是什么?希望只使用 Sun Java 6 附带的库.
I have an image that is Base64 encoded. What is the best way to decode that in Java? Hopefully using only the libraries included with Sun Java 6.
推荐答案
从 v6 开始,Java SE 附带 JAXB.javax.xml.bind.DatatypeConverter 有一些静态方法可以让这一切变得简单.请参阅 <代码>parseBase64Binary() 和 printBase64Binary().
As of v6, Java SE ships with JAXB. javax.xml.bind.DatatypeConverter has static methods that make this easy. See parseBase64Binary() and printBase64Binary().
这篇关于在 Java 中解码 Base64 数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在 Java 中解码 Base64 数据
基础教程推荐
- 无法复制:“比较方法违反了它的一般约定!" 2022-01-01
- 问题http://apache.org/xml/features/xinclude测试日志4j 2 2022-01-01
- Spring AOP错误无法懒惰地为此建议构建thisJoinPoin 2022-09-13
- 存储 20 位数字的数据类型 2022-01-01
- 使用堆栈算法进行括号/括号匹配 2022-01-01
- Struts2 URL 无法访问 2022-01-01
- 如何对 Java Hashmap 中的值求和 2022-01-01
- REST Web 服务返回 415 - 不支持的媒体类型 2022-01-01
- 修改 void 函数的输入参数,然后读取 2022-01-01
- RabbitMQ:消息保持“未确认"; 2022-01-01
