Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

python "pickle" utility in java?

807605Aug 18 2007 — edited Aug 18 2007
Hi There! I'm a beginner programmer and I'm doing very simple projects like a cd manager for all my cd's and so on. I've seen in python a very interesting utility which simply do: If you have an object "foo" (python code)
import pickle

file = open("path_to_a_text_file","w")
pickle.dump(foo,file)
file.close()
So in a text file I have an object saved and I can load it by simply:
file1= open("path_to_the_text_file","r")
myObjectFoo = pickle.load(file1)
file1.close()
So it's a very simple database I guess (I'm not in databases yet).

So the questions is: How could I store a java object (for example cdManager) in a text file and then open it and use it in my code?


Thank you very much to all!!!!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 15 2007
Added on Aug 18 2007
4 comments
902 views