文件名称:src
- 所属分类:
- JSP源码/Java
- 资源属性:
- [Java] [源码]
- 上传时间:
- 2015-07-09
- 文件大小:
- 9kb
- 下载次数:
- 0次
- 提 供 者:
- bp***
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
用URLConnection获取要下载文件的长度、头部等相关信息,并设置响应的头部信息。并且通过URLConnection获取输入流,将文件分成指定的块,每一块单独开辟一个线程完成数据的读取、写入。通过输入流读取下载文件的信息,然后将读取的信息用RandomAccessFile随机写入到本地文件中。同时,每个线程写入的数据都文件指针也就是写入数据的长度,需要保存在一个临时文件中。这样当本次下载没有完成的时候,下次下载的时候就从这个文件中读取上一次下载的文件长度,然后继续接着上一次的位置开始下载。并且将本次下载的长度写入到这个文件中。-Get to download the file length, head and other related information with URLConnection, and sets the response header information. And obtain input stream through URLConnection, specify the file into blocks each open a separate thread finishes reading the data written. Download the file to read the information flow through the input, then the read information in RandomAccessFile random write to a local file. At the same time, each thread writes data file pointer is written length of the data needs to be stored in a temporary file. So that when this download is not completed, the next time you download a downloaded file is read on the length the file, and then continue to the last position and then start the download. And writes this length to download this file.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
src
...\com
...\...\hoo
...\...\...\download
...\...\...\........\BatchDownloadFile.java
...\...\...\........\DownloadFile.java
...\...\...\........\SaveItemFile.java
...\...\...\entity
...\...\...\......\DownloadInfo.java
...\...\...\test
...\...\...\....\TestDownloadMain.java
...\...\...\util
...\...\...\....\DownloadUtils.java
...\...\...\....\LogUtils.java