标签:dex alt write gen create 报错 ati jpg file
今天做了个实现验证码功能的小demo,但验证码无法输出到访问页面,报错如下:
javax.imageio.IIOException: Can‘t create output stream!
java.nio.file.AccessDeniedException: C:\Program Files\Apache Software Foundation\Tomcat 9.0\temp\imageio155147286904334316.tmp
图片写入response.getOutputStream代码如下:
ImageIO.write(bufferedImage, "jpg", response.getOutputStream());
随后百度了一下,将
ImageIO.write(bufferedImage, "jpg", response.getOutputStream());
改为
JPEGImageEncoder encoder= JPEGCodec.createJPEGEncoder(response.getOutputStream());
encoder.encode(bufferedImage);
就可以正常显示了 _(:з」∠)_ 。。。
标签:dex alt write gen create 报错 ati jpg file
原文地址:http://www.cnblogs.com/qianggu/p/7495362.html