org.jgroups.util
public class Marshaller extends Object
Version: 1.0 This class marshalls classes, in other words it serializes and deserializes classes to and from object streams. It performs a magic number matching to decrease the number of bytes that are being sent over the wire. If no magic number is available for the class, the classname is sent over instead
Constructor Summary | |
---|---|
Marshaller() |
Method Summary | |
---|---|
static Externalizable | read(ObjectInput in)
reads the magic number, instantiates the class (from the
configurator) and invokes the readExternal method on the object.
|
static void | write(Externalizable inst, ObjectOutput out)
Writes an object to the ObjectOutput stream.
|
Parameters: in an ObjectInput stream - the stream should be composed as follows:
[boolean -> int|string -> object data]
If the boolean is true, then the next value is an int, the magic number.
If the boolean is false, then the next value is a string (the class name)
The object data is what the object instance uses to populate its fields
Parameters: inst - an object instance to be serialized, can not be null out - the ObjectOutput stream we will write the serialized data to