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

📄 download.java

📁 希望这个源码对大家有用
💻 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();
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -