Java RandomAccessFile?÷?
???????????? ???????[ 2014/10/29 10:05:19 ] ????????Java ???? ????
????????RandomAccessFile???????????????????????????????????????????????飬????ò??????????????????????????????????д????????????????????????????????????????????????н??з?飬???д??
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.RandomAccessFile;
/**
* ????????????????????д????
*/
public class Test {
public static void main(String[] args) throws Exception {
// ???????????????????????л???????????С?????
RandomAccessFile raf = new RandomAccessFile("D://abc.txt"?? "rw");
raf.setLength(1024*1024); // ????? 1M ????????
raf.close();
// ???д??????????
String s1 = "??????????";
String s2 = "??????????";
String s3 = "???????????";
String s4 = "??????????";
String s5 = "??????????";
// ??????????д????????
new FileWriteThread(1024*1??s1.getBytes()).start(); // ???????1024???????д??????
new FileWriteThread(1024*2??s2.getBytes()).start(); // ???????2048???????д??????
new FileWriteThread(1024*3??s3.getBytes()).start(); // ???????3072???????д??????
new FileWriteThread(1024*4??s4.getBytes()).start(); // ???????4096???????д??????
new FileWriteThread(1024*5??s5.getBytes()).start(); // ???????5120???????д??????
}
// ?????????????????λ??д?????????
static class FileWriteThread extends Thread{
private int skip;
private byte[] content;
public FileWriteThread(int skip??byte[] content){
this.skip = skip;
this.content = content;
}
public void run(){
RandomAccessFile raf = null;
try {
raf = new RandomAccessFile("D://abc.txt"?? "rw");
raf.seek(skip);
raf.write(content);
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} finally {
try {
raf.close();
} catch (Exception e) {
}
}
}
}
}
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
Java???????????Щ???????????????Java????????????????Java?б???Map????????Java Web???????????????Java??????????????д?????Java????????7???????????????????????(java .net ?????)???Java??????????Python??????Java webdriver??λ????????′????е?????Java??д??????????????????Java???????????????JavaScript????????????Java?????????????????? Java???????10??????????????Java?м????????????????java???????ü???????????м???????????????????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????