/** * * @param BASE64str bas64字符串 * @param path 存储地址 * @return 存储地址 */ public static String BASE64CodeToBeImage(String BASE64str,String path){ BufferedImage image = null; byte[] imageByte = null; try { imageByte = DatatypeConverter.parseBase64Binary(BASE64str); ByteArrayInputStream bis = new ByteArrayInputStream(imageByte); image = ImageIO.read(new ByteArrayInputStream(imageByte)); bis.close(); File outputfile = new File(path); ImageIO.write(image, "jpg", outputfile); } catch (IOException e) { e.printStackTrace(); } return null; }