文件名称:src
-
所属分类:
- 标签属性:
- 上传时间:2015-07-09
-
文件大小:8.95kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
用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/
src/com/
src/com/hoo/
src/com/hoo/download/
src/com/hoo/download/BatchDownloadFile.java
src/com/hoo/download/DownloadFile.java
src/com/hoo/download/SaveItemFile.java
src/com/hoo/entity/
src/com/hoo/entity/DownloadInfo.java
src/com/hoo/test/
src/com/hoo/test/TestDownloadMain.java
src/com/hoo/util/
src/com/hoo/util/DownloadUtils.java
src/com/hoo/util/LogUtils.java
src/com/
src/com/hoo/
src/com/hoo/download/
src/com/hoo/download/BatchDownloadFile.java
src/com/hoo/download/DownloadFile.java
src/com/hoo/download/SaveItemFile.java
src/com/hoo/entity/
src/com/hoo/entity/DownloadInfo.java
src/com/hoo/test/
src/com/hoo/test/TestDownloadMain.java
src/com/hoo/util/
src/com/hoo/util/DownloadUtils.java
src/com/hoo/util/LogUtils.java
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.