62,615
社区成员
发帖
与我相关
我的任务
分享
public InputStream getUrlInputStream() throws Exception {
URL url = null;
InputStream is = null;
try {
inputPath = URLDecoder.decode(inputPath, "UTF-8");
url = new URL(inputPath);
is = url.openStream();
} catch (Exception ex) {
ex.printStackTrace();
}
/**finally {
try {
//if (is != null)
//is.close();
} catch (Exception e) {
e.printStackTrace();
}
}*/
return is;
}
如果是这个代码,关闭了就无法返回资源了?这个要怎么处理呢?