The easiest way is to use serialization . Thus, your object classes must implement serializable, so all members (primitives and most standard Java classes already do this). This allows matching between instances of objects and streams of bytes at runtime.
You also need a protocol for trance. You can watch RMI if you do not want to deal with streaming byte streams over a wire, although this is not difficult. However, using RMI allows you to create more powerful distributed Java applications later.
b_erb source
share