Here you can find the source of base64StringToImage(String imageString)
public static BufferedImage base64StringToImage(String imageString)
//package com.java2s; //License from project: Mozilla Public License import javax.imageio.ImageIO; import java.awt.image.BufferedImage; import java.io.*; import java.util.Base64; public class Main { public static BufferedImage base64StringToImage(String imageString) { BufferedImage image = null; byte[] imageByte; try {/*from w w w .j a v a 2 s. c o m*/ imageByte = Base64.getDecoder().decode(imageString); ByteArrayInputStream bis = new ByteArrayInputStream(imageByte); image = ImageIO.read(bis); bis.close(); } catch (Exception e) { e.printStackTrace(); } return image; } }