我想实现下载一个rss feed文件 比如http://blog.csdn.net/rss.html?type=Homechannel=database我实现的代码如下  /**  
     * 根据URL得到输入流  
     * @param urlStr  
     * @return  
     */  
    public InputStream getInputStreamFromURL(String urlStr) {  
        HttpURLConnection urlConn = null;  
        InputStream inputStream = null;  
        try {  
            url = new URL(urlStr);  
            urlConn = (HttpURLConnection)url.openConnection();  
            inputStream = urlConn.getInputStream();      
        } catch (MalformedURLException e) {  
            e.printStackTrace();  
        } catch (IOException e) {  
            e.printStackTrace();  
        }  
          
        return inputStream;  
    }  
private void downloadFile(String urlString, String filename) {
//BufferedReader buffer;
try {
InputStream is = getInputStreamFromURL(urlString);
OutputStream os = openFileOutput(filename, MODE_WORLD_READABLE);
byte[] buf = new byte[1024];
int hasRead = 0;
while ((hasRead = is.read(buf)) > 0) {
os.write(buf, 0, hasRead);
}
is.close();
os.close(); } catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
我通过断点监视看到 在返回输入流总是为null,是怎么回事?