// 构造urlurl url = new url(endstr); // 打开url连接urlconnection con = url.openconnection(); // 得到url的输入流inputstream input = con.getinputstream();// 设置数据缓冲byte[] bs = new byte[1024 * 2];// 读取到的数据长度int len;// 输出的文件流保存图片至本地outputstream os = new fileoutputstream(“d:\\a.jpg”);while ((len = input.read(bs)) != -1) {os.write(bs, 0, len);}os.close();input.close();?