code: public ProcResult run() throws StartupException, TimeoutException, ExternalProcessFailureException {
  
          if (stdout != defaultStdout && outputConsumer != null) {
              throw new IllegalArgumentException("You can either ...");
          }
  
          try {
              Proc proc = new Proc(command, args, env, stdin, outputConsumer != null ? outputConsumer : stdout , directory, timoutMillis, expectedExitStatuses, stderr);
  
              return new ProcResult(proc.toString(), defaultStdout == stdout && outputConsumer == null ? defaultStdout : null, proc.getExitValue(), proc.getExecutionTime(), proc.getErrorBytes());
          } finally {
              stdout = defaultStdout = new ByteArrayOutputStream();
              stdin = null;
          }
      }
docs: Spawn the actual execution.
  This will block until the process terminates.
  @return the result of the successful execution
  @throws StartupException if the process can't be started
  @throws TimeoutException if the timeout kicked in
  @throws ExternalProcessFailureException if the external process returned a non-null exit value