Each record is written and read from the file with the help of the methods .The instance of this class not only helps in creating or opening an existing file but also provide a parameter to specify the mode of operation such as read(r) or write(w) whien opening a file.If you can't limit the dataset to a fixed length and you intend to update a dataset making it longer, you can also leave a pointer at the end of the first part of a dataset and continue it later in the file. If a lot of editing takes place it would make here sense too, to rearrange You can't easily insert data into the middle of a file.You'd basically have to read all the remaining data, write the "new" data and then rewrite the "old" data.
You have a major file design problem, as you are assuming facilities like inserting into the middle of a file that don't exist in any filesystem I have used since about 1979.Bu there's one case which is not working for me yet. 3 from the file and i add some data to it in my application and i want to update it in the file i have no idea how to do this.If it has the same length as befor i can simply overwrite the old data.(A CRUD operation can also be implemented in a sequential access file as well, but in this case we have to rewrite the complete file content on each CRUD operation to achieve the same effect.This is infeasible, especially when we can formulate a direct access mechanism through code in Java.) Let the following POJO be our simple record structure: impose a restriction of a fixed length character sequence whi nreading or writing string values from the file, respectively.