java base64 转 图片
时间: 2023-12-13 21:34:19 浏览: 181
以下是Java中将Base64编码的字符串转换为图片的方法:
```java
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Base64;
public class Base64ToImage {
public static void main(String[] args) {
String base64Image = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACW0lEQVR4nL2Tz0tUURjHv7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7M
阅读全文