Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
通过 ImageIO.read(url) 读取图像时,出现连接被拒绝错误。URL 由公共 IP 地址 + 图像的相对路径组成。错误是因为防火墙设置吗?在浏览器上,URL 有效。
似乎您的代码有问题。试试这个调试:
URL url = new URL("yoururlhere"); BufferedImage bi = ImageIO.read(url); System.out.println(bi);