RandomAccessFile
读写操作
写:
void write(int d):写一个字节,写的是读取int的低8位
void write(byte[] b):写若干字节,写出的字节量就是给定的数组的长度.换句话说,就是将数组中所有字节都写出
void write(byte[] b,int offset,int len):将数组中从iffset连续开始写入len个字节
例如 raf.write(byte,5,5);
void write(byte[] b,int offset,int len)
import java.io.File;
import java.io.IOException;
import java.io.RandomAccessFile;
public class RandomAccessFileDemo {
public static void main(String[] args) throws IOException {
File file=new File("buf.dat");
if(!file.exists()){
file.createNewFile