Hi,

I have an entity class which I would like to write from one machine to another using sockets. As each machine has a separate copy of the entity class (identical except for package declaration) a ClassCastException will be throw; it seems the only way I could do this is by extracting the data from within the entities, sending the data, then rebuilding the entities on the receiving machine, however I am sure many people must have had to do this in the past so I was wondering if there were any better solutions?

Thanks very much for your help

Dear,

Use Object Serialization/Deserialization technique. Please refere java.io.Serializable, java.io.ObjectInputStream and java.io.ObjectOutputStream.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.