日期:2014-05-20 浏览次数:21036 次
class DownloadService implements Runnable{ public void run() { try { String temp=http://192.168.1.100:8080/mp3/What if she is an angel.mp3; String adress=mp3Address.replace(" ", " "); System.out.println(adress); InputStream is = downloader.getInputStreamFromUrl(adress); } } public InputStream getInputStreamFromUrl(String urlStr) throws MalformedURLException, IOException { URL url = new URL(urlStr); HttpURLConnection urlConn = (HttpURLConnection) url.openConnection(); InputStream inputStream = urlConn.getInputStream(); return inputStream; }