I want to perform the read and write the content operation in the file. For this I have created Serialized class to write and read from the file using ObjectInputStream and ObjectOutputStream. If I open and close every time its working fine. But every time open and close the file for read and write might be costly operation. I would like to know is there any better way to do this without closing the file for every time.