用Java实现HTTP断点续传功能(3)Java认证考试
文章作者 100test 发表时间 2010:02:02 16:46:31
来源 100Test.Com百考试题网
/*
**FileSplitterFetch.java
*/
package NetFox.
import java.io.*.
import java.net.*.
public class FileSplitterFetch extends Thread {
String sURL. //File URL
long nStartPos. //File Snippet Start Position
long nEndPos. //File Snippet End Position
int nThreadID. //Thread s ID
boolean bDownOver = false. //Downing is over
boolean bStop = false. //Stop identical
FileAccessI fileAccessI = null. //File Access interface
public FileSplitterFetch(String sURL,String sName,long nStart,long nEnd,int id) throws IOException
{
this.sURL = sURL.
this.nStartPos = nStart.
this.nEndPos = nEnd.
nThreadID = id.
fileAccessI = new FileAccessI(sName,nStartPos).
}
public void run()
{
while(nStartPos