我怎样才能将图像转换为使用Java一个base64字符串? [英] How can I convert an image to a base64 string using Java?

查看:99
本文介绍了我怎样才能将图像转换为使用Java一个base64字符串?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正如标题所示,我想知道如何将图像转换为Java中的一个Base64字符串。我怎样才能做到这一点?

As the title indicates, I want to know how to convert an image to a base64 string in Java. How can I do this?

推荐答案

使用的 的Base64 类。

如果你在pre-8的Java,看看下面的资源之一:

If you're on pre-Java 8, have a look at one of the following resources:

的Base64 codeR - 开放-source Base64编码的连接codeR /在去codeR的Java

在org.apache.commons的Base64类。codec.binary包

这篇关于我怎样才能将图像转换为使用Java一个base64字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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