public void seek(long pos)
throws IOException
pos - the offset position, measured in bytes from the beginning of the file, at which to set the file pointer.自己查JDK类库帮助吗,.
try{
a.seek(n);
}catch(IOException e){
}
你先seek到要改的地方,再write就行了.
throws IOException
pos - the offset position, measured in bytes from the beginning of the file, at which to set the file pointer.自己查JDK类库帮助吗,.
try{
a.seek(n);
}catch(IOException e){
}
你先seek到要改的地方,再write就行了.
(2)public RandomAccessFiel(String name,String mode)throws FileNotFoundException注:其中第一个参数指出文件的路径,第二个参数指出文件的是否可读写("r"和"rw")。publc void seek(long pos)将文件位置指针移到pos指出的位置上。