java中base64转图片
时间: 2023-11-27 15:05:17 浏览: 108
Java中,可以使用Base64类将Base64编码的字符串转换为图片。以下是一个示例代码:
```java
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Base64;
public class Base64ToImage {
public static void main(String[] args) {
String base64Str = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACW0lEQVR4nLWTT0jTURzHv7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7MzO7M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