?? download.java
字號:
import java.io.*;
import java.net.*;
public class DownLoad{
URL url;
String objFile;
long nStartPos;
RandomAccessFile rf;
public DownLoad(String objFile,long nStartPos) throws IOException{
this.nStartPos=nStartPos;
this.objFile=objFile;
rf=new RandomAccessFile(objFile,"rw");
//
rf.seek(nStartPos);
}
public synchronized int write(byte[] b,int nStart,int len){
int n=-1;
try{
rf.write(b,nStart,len);
n=len;
}catch(IOException ioe){
ioe.printStackTrace();
}
return n;
}
public void close()throws IOException{
rf.close();
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -