java怎么读取图片内容
收起
云计算小粉
2018-05-10 20:07:37
3175
0
2
条回答
写回答
取消
提交回答
-
// 从文件读取
File sourceimage = new File("taobao.gif");
image = ImageIO.read(sourceimage);
// 从输入流读取
InputStream is = new BufferedInputStream(new FileInputStream("mid.jpg"));
image = ImageIO.read(is);
// 从url中读取
URL url = new URL("https://img.alicdn.com/tfs/TB1TG0RJ6DpK1RjSZFrXXa78VXa-190-121.gif");
image = ImageIO.read(url);
2019-07-17 22:15:52
-
InputStream("url")
2019-07-17 22:15:52