Marshalling of Arguments
Objects passed as arguments to invoke() must be marshaled for transmission over the network.
The representation of a Java object inside the Java Virtual Machine is complex:
- An object includes references to all its fields, which may themselves be objects. These may in turn reference other objects.
- An object will reference its class object, which contains runtime information about the object’s type.
This internal representation is also not standardized—different vendors implementation of the JVM will certainly use different representations.
If objects are to be exchanged between JVMs, we need a standardized way to encode all the information.