`

协议版本

 
阅读更多
URL url = new URL("http://www.mydomain.com/down.zip";); 
HttpURLConnection httpConnection=(HttpURLConnection) url.openConnection(); 
    //设置断点续传的开始位置 
    httpConnection.setRequestProperty("RANGE","bytes=10000"); 
    //设置请求信息
    httpConnection.setRequestProperty("GET","/down.zip HTTP/1.1");
    //设置接受信息
httpConnection.setRequestProperty("Accept","image/gif,image/x-xbitmap,application/
msword,*/*");
    //设置连接信息
    httpConnection.setRequestProperty("Connection","Keep-Alive"); 
    //获得输入流 
InputStream input = httpConnection.getInputStream();
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics