URL url = new URL("http://www.sjtu.edu.cn/down.zip"); HttpURLConnection httpConnection = (HttpURLConnection)url.openConnection(); // 设置 User-Agent httpConnection.setRequestProperty("User-Agent","NetFox"); // 设置断点续传的开始位置 httpConnection.setRequestProperty("RANGE","bytes=2000070"); // 获得输入流 InputStream input = httpConnection.getInputStream();