RandomAccessFile类主要方法有哪些?

RandomAccessFile类主要方法有哪些?

RandomAccessFile类具备了文件操作的功能。(重要)
构造函数
RandomAccessFile(File file,String mode)
RandomAccessFile)String name,String mode)
参数说明
file:指定的文件对象
Mode:指定的操作模式(r为读模式,rw为读写模式)
Name:指定的文件名
RandomAccessFile类的主要方法

FileDescriptor getFD() //获取文件的描述
long getFilePointer() //获取文件指针的位置
long length() //获取文件的长度
int read() //从文件中读取一个字节
int read(byte[] b) //从文件中读取b.length个字节的数据并保存到数组b中
int read(byte[] b,int off,int len) //从文件中读取len个字节的数据并保存到数组b的指定位置中
boolean readBoolean() //从文件中读取一个boolean值
byte readbyte() //从文件读取一个字节
char readChar() //从文件读取一个字符
double readDouble() //从文件中读取一个double值
float readFloat() //从文件中读取一float值
void readFully(byte[] b) //从文件中的当前指针位置开始读取b.length个字节的数据到数组b中
void readFully(byte[] b,int off,int lne) //从文件中的当前指针位置开始读取len个字节的数据到
//数组b的数组指定位置中
int readInt() //从文件中读取一个int值
String readLine() //从文件中读取一个字符串
long readLong() //从文件中读取一个long值
short readShort() //从文件中读取一个short值
int readUnsignedByte() //从文件中读取一个无符号的八位数值
int readUnsignedShort() //从文件中读取一个无符号的十六位数值
String readUTF() //从文件中读取一个字符串
void seek(long pos) //指定文件指针在文件中的位置
void setLength(long newLength) //设置文件的长度
int skipBytes(int n) //在文件中跳过指定的字节数
void write(byte[] b) //向文件中写入一个字节数组
void write(byte[] b,int off,int len) //向文件中写入数组b中从off位置开始长度为len的字节数据
void write(int b) //向文件中写入一个int值
void writeBoolean(boolean v) //向文件中写入一个boolean值
void writeByte(int v) //向文件中写入一个字节
void writeByte(String s) //向文件中写入一个字符串
void writeChar(int v) //向文件中写入一个字符
void writeChars(String s) //向文件中写入一个作为字符数据的字符串
void writeDouble(double v) //向文件中写入一个double值
void writeFloat(float v) //向文件中写入一个float值
void writeInt(int v) //向文件中写入一个int值
void writeLong(long v) //向文件中写入一个long值
void writeShort(int v) //向文件中写入一个短型int值
void writeUTF(String str) //向文件中写入一个UTF字符串