📄 tbdl.java
字号:
import java.io.BufferedInputStream;
import java.io.IOException;
import org.apache.commons.net.ftp.FTPClient;
public class TBdl extends Thread{
FTPClient ftpdl;
WByte wbyte;
BufferedInputStream bindl;
String path;
TBdl(WByte wbyte,BufferedInputStream bindl,FTPClient ftpdl) throws IOException{
this.wbyte = wbyte;
// this.path = path;
this.ftpdl = ftpdl;
this.bindl = bindl;
}
// 下载一个缓冲区的数据
public void run(){
try{
wbyte.flag_busy = 1;
wbyte.length = bindl.read(wbyte.buf,0,wbyte.bufsize);
wbyte.flag_empty = 0;
if(wbyte.length == -1){
wbyte.flag_over = 1;
}
wbyte.flag_busy = 0;
}catch(Exception e){
System.out.println("error occur when download.");
}
// try{
// findl.close();
// bindl.close();
// }catch(Exception e){
// System.out.println("error occur when close stream in download");
// }
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -