code: public Object[] marshalParams(RpcRequest req) throws RpcException {
          Object[] converted = new Object[params.size()];
          Object[] reqParams = req.getParams();
          if (reqParams.length != converted.length) {
              String msg = "Function '" + req.getMethod() + "' expects " + 
                     params.size() + " param(s). " + reqParams.length + " given.";
              throw invParams(msg);
          }
          
          for (int i = 0; i < converted.length; i++) {
              converted[i] = params.get(i).getTypeConverter().marshal(reqParams[i]);
          }
          
          return converted;
      }
docs: Marshals the req.params to their RPC format equivalents.  For example, a Java Struct
  class will be converted to a Map.
  
  @param req RpcRequest to marshal params for
  @return RPC representation of params in req
  @throws RpcException If param length differs from expected param length for this function,
  or if any parameters fail IDL type validation