BitMatrix bitMatrix = QRCodeUtils.createCode(content);
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
MatrixToImageWriter.writeToStream(bitMatrix,"PNG",byteArrayOutputStream);
byte[] bytes = byteArrayOutputStream.toByteArray();
Image instance= Image.getInstance(image);
在网上搜半天都是复制粘贴怪 转BufferedImage, 自己记录一下。