Output operations that write past the current end of the implied array cause the array to be extended...
It is generally true of all the reading routines in this class that if end-of-file is reached before the desired number of bytes has been read, an EOFException (which is a kind of IOException) is thrown. ...
seek(): Sets the file-pointer offset, measured from the beginning of this file, at which the next read or write occurs. The offset may be set beyond the end of the file. Setting the offset beyond the end of the file does not change the file length. The file length will change only by writing after the offset has been set beyond the end of the file.
Before really writing I have a read statement to check if the record with that recNo exists and is already created by other. It is this statement that throws the EOFException.