⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tbdl.java

📁 java实现的ftp文件传输
💻 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 + -