[英]put XML file into InputStream
您無法從該URL讀取到FileInputStream中,因為它不是文件。 但是,您可以讀入InputStream:
InputStream input = new URL("http://www.nasa.gov/rss/dyn/image_of_the_day.rss").openStream();
通過使用java.net.URL構造這樣的新對象。 URL url =新網址(“ http://www.nasa.gov/rss/dyn/image_of_the_day.rss ”); 然后簡單地調用url.openStream(); //這將返回InputStream對象
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.