| java.lang.Object org.jgroups.util.Marshaller
Marshaller | public class Marshaller (Code) | | Title: JGroups Communications
Description: Contact me at mail@filip.net
Copyright: Copyright (c) 2002
Company: www.filip.net
author: Filip Hanik author: Bela Ban version: 1.0 version: This class marshalls classes, in other words it serializes and deserializes classes version: to and from object streams. version: It performs a magic number matching to decrease the number of bytes that are being sent version: over the wire. version: If no magic number is available for the class, the classname is sent over instead |
Marshaller | public Marshaller()(Code) | | |
read | public static Externalizable read(ObjectInput in) throws IOException(Code) | | reads the magic number, instantiates the class (from the
configurator) and invokes the readExternal method on the object.
If no magic number is present, the method will read the
string and then get the class from the configurator.
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
|
write | public static void write(Externalizable inst, ObjectOutput out) throws IOException(Code) | | Writes an object to the ObjectOutput stream.
If possible, we will send over a magic number instead of the class name
so that we transfer less amount of data.
Parameters: inst - - an object instance to be serialized, can not be null Parameters: out - - the ObjectOutput stream we will write the serialized data to |
|
|