} else if (useRefs && refMap.containsKey(o))// see if this object has been marshalled before.
{
out.writeByte(MAGICNUMBER_REF);
writeReference(out, refMap.get(o));
} else if (o instanceof ReplicableCommand) {
ReplicableCommand command = (ReplicableCommand) o;
if (command.getCommandId() > -1) {
out.writeByte(MAGICNUMBER_METHODCALL);
marshallCommand(command, out, refMap);
} else {
throw new IllegalArgumentException("MethodCall does not have a valid method id. Was this method call created with MethodCallFactory?");
}