public void writeExternal(AnnotatedObjectOutputStream out) throws IOException { out.writeByte(SERIAL_VERSION); out.writeByte(buildFlags()); if (_requestObj != null) { out.writeObject(_requestObj); } else { /** write stubClassId, so that the ServerPeer will marsh/unmarsh the method arguments more faster */ out.writeLong(lrmiId); out.writeLong(objectId); out.writeInt(methodOrderId); out.writeLong(remoteClassLoaderId); if (operationPriority == OperationPriority.CUSTOM && targetVersion.greaterOrEquals(PlatformLogicalVersion.v9_7_0)) { //Place holder for dedicated thread pools IOUtils.writeRepetitiveString(out, ""); } Class<?>[] types = invokeMethod.methodTypes; for (int i = 0; i < types.length; i++) { IOUtils.marshalValue(types[i], args[i], out); } } }