使用 JAVA 代码生成二维码很容易 但是我想生成以后直接保存在 File 表中
现在代码如下
生成了一个 BufferedImage 然后转成 byte 数组
public static byte[] imageToBytes(BufferedImage bImage) throws IOException {
ByteArrayOutputStream out = new ByteArrayOutputStream();
ImageIO.write(bImage, FORMAT_NAME, out);
return out.toByteArray();
}
再
AVFile file = new AVFile(orderId, imageToBytes(image));
file.save();
部署后台调用时提示 {"code":1,"error":"Can't create an ImageInputStream!"}
求解该如何处理