public class ImgeUtils { public static String img2String(BufferedImage img,String type){ String imgStr = null; ByteArrayOutputStream baos = new ByteArrayOutputStream(); try { ImageIO.write(img, type, baos); byte[] imgByte = baos.toByteArray(); imgStr…