aspose file tools
The moose likes Beginning Java and the fly likes How to delete an object which is seraliazed from the file Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "How to delete an object which is seraliazed from the file" Watch "How to delete an object which is seraliazed from the file" New topic
Author

How to delete an object which is seraliazed from the file

Ashuthosh san
Ranch Hand

Joined: Jan 28, 2009
Posts: 35
Hi,

I am writing some objects to file using writeObject(), and after reading using readObject() i want to delete that object from that file.
Could you please let me know how do i do it?

I want to delete those objects from the file once i am read.

Regards
Asha

amit punekar
Ranch Hand

Joined: May 14, 2004
Posts: 488
Hi,
I think you are writing the object's state using ObjectOutputStream that has handle to FileOutputStream. If that is the case you can delete the file in which the object was serialized using java.io.File.
Hope this helps.


Regards,
Amit
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: How to delete an object which is seraliazed from the file
 
Similar Threads
Random Access File Question
How to delete from the middle of the file using object streams
Update Serializable Object
Delete a file created and opened in IE
Deleting data form a file?