displaypic
是base64
编码的图片,但imageio.read(displaypic)
返回null
。没有例外
byte[] imageBytes = Base64.decodeBase64(DisplayPic);
ByteArrayInputStream bis = new ByteArrayInputStream(imageBytes);
try {
BufferedImage image = ImageIO.read(bis);
File dpPath = new File(DisplayPicturePath);
if(!dpPath.exists())
dpPath.createNewFile();
ImageIO.write(image, "jpeg",dpPath);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}