我试图下载从URL中image
...我的代码是:读写镜像
String url = "http://mysite.com/image.xyz"
其中xyz
可以是JPG/PNG/JPEG ..
我能够使用
BufferedImage image = ImageIO.read(url);
读取URL图像现在,我需要的是,虽然图像写入到文件中使用:
ImageIO.write(image, "variable" , new File("C:\\out1.jpg"));
我需要的variable
价值由xyz
...值替换其中xyz的值将会从URL extracted
....
那么如何实现这个...... ..
很好地回答并解释了...... – RanRag
对于u.getFile() – Thomas
+1在问题中,变量'url'的类型是'String'。 –