File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Update Serializable Object Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Update Serializable Object" Watch "Update Serializable Object" New topic
Author

Update Serializable Object

Amit Bathla
Ranch Hand

Joined: Feb 11, 2005
Posts: 51
sir i want to know how to update object that i have written in file..
that is serialized object..
please help me sir
thanks
Amit


Amit
University of Florida
Amit Bathla
Ranch Hand

Joined: Feb 11, 2005
Posts: 51
just tell me how to delete one or more objects from a file that i have written into file....
Amit
karthikeyan Chockalingam
Ranch Hand

Joined: Sep 06, 2003
Posts: 259
I have provided a sample code to serialize and deserialize.




http://www.skillassert.com


Amit Bathla
Ranch Hand

Joined: Feb 11, 2005
Posts: 51
that i know sir..
but how to delete or update an object from file???
Amit
Garrett Rowe
Ranch Hand

Joined: Jan 17, 2006
Posts: 1296
You'll have to explain a bit further what you're trying to do. Does your file conatain an array of objects, and you want to delete one. Or does your file contain just one object and you want to erase it. (Although it seem you could do that by just deleting the file).


Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them. - Laurence J. Peter
Keith Lynn
Ranch Hand

Joined: Feb 07, 2005
Posts: 2367
If the objects are written sequentially to the file, the only way you're going to update it is to read all of the objects from the file into memory, and then write the updated objects to the file.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Update Serializable Object