content="data:image/jpeg;base64,/dsgsgsd...";
Pattern pattern=Pattern.compile("data:image/(.*?);base64,");
Matcher matcher=pattern.matcher(content);
String type="";
if(matcher.find()){
type=matcher.group(1);
}else{
return;
}
String base64=content.replaceAll(matcher.group(0),"");
byte[] buffer=new BASE64Decoder(base64).decodeBuffer(base64);
//转为字节流或者文件
ByteArrayInputStream bis=new ByteArrayInputStream(buffer);
处理Base64的图片
猜你喜欢
转载自blog.csdn.net/g_y_x_/article/details/86656448
今日推荐
周排行