取得inputStream的长度

1.网络下载文件

1 URL url = new URL(strUrl);
2 
3 HttpURLConnection httpconn = (HttpURLConnection)url.openConnection();  
4 
5 httpconn.getContentLength();

 2.本地文件

1 InputStream inputStream = urlCon.getInputStream();
2 
3 inputStream.available();

 来源:http://hold-on.iteye.com/blog/1017449

posted @ 2016-03-02 09:44  fanhq  阅读(17359)  评论(0编辑  收藏  举报