class DownloadFileAsync extends AsyncTask<String, String, String> {        @Override
        protected void onPreExecute() {
            super.onPreExecute();
        }        @Override
        protected String doInBackground(String... aurl) {
        
         String filePaht="/sdcard/";         String   fileName = aurl[0].substring(aurl[0].lastIndexOf("/") + 1,
                    aurl[0].length());            int count;
            try {                URL conurl = new URL(aurl[0]);
                File file = new File(filePath + fileName);                InputStream input = new BufferedInputStream(conurl.openStream());
                OutputStream output = new FileOutputStream(file);
                byte data[] = new byte[1024];                while ((count = input.read(data)) != -1) {                    output.write(data, 0, count);
                }
                output.flush();
                output.close();
                input.close();            } catch (Exception e) {
                Log.e("error", e.getMessage().toString());
            }
            return null;
        }        @Override
        protected void onProgressUpdate(String... values) {
            super.onProgressUpdate(values);        }        @Override
        protected void onPostExecute(String result) {
           
                      Toast.makeText(
                        PhotosActivity.this,
                        getResources().getString(R.string.downFileTip) + result,
                        Toast.LENGTH_SHORT).show();
                    }    }我用这个方法可以下载图片但是不能下载文件,例如pdf文件
下载文件时InputStream input = new BufferedInputStream(conurl.openStream());抛出IO异常,通过网络调查 是因为得不到数据流,可是为什么图片的就可以,文件就不可以呢android   网络