This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
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: 511
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://aspose.com/file-tools
 
subject: How to delete an object which is seraliazed from the file
 
Similar Threads
Update Serializable Object
Delete a file created and opened in IE
How to delete from the middle of the file using object streams
Random Access File Question
Deleting data form a file?