Forums Register Login

File attribute in a serialized Object.

+Pie Number of slices to send: Send
In a class which is implementing Serializable Interface there exists an attribute of a File type.

How do we handle such attribute ?
+Pie Number of slices to send: Send
Sorry but I don't understand what your problem is, can you provide more detail.
For example: Is your problem specifically to do with serialization? what do you mean "How do we handle such attribute"?
+Pie Number of slices to send: Send
The object to be serialized has an attribute as File type.
1
+Pie Number of slices to send: Send
 

Santosh Kumar Nayak wrote:The object to be serialized has an attribute as File type.



I don't really understand your problem since class java.io.File is serializable so an attribute of type File will be serialised when the containing class is serialised !
+Pie Number of slices to send: Send
Remember that a File is just an abstract representation of a file/directory pathname.
The File class already overrides writeObject and readObject to make the path system independent when serializing and de-serializing on different systems.
Willie Smits can speak 40 languages. This tiny ad can speak only one:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 902 times.
Similar Threads
How to configure log4j.xml to log only WARN and above logs in JBOSS?
how to do
JAD
How to read a property from a properties file in Ant?
Cannot load applet
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 15, 2024 22:13:05.