code: public static InputStream getCommandResult(
  			CommandLine cmdLine, File dir, int expectedExit,
  			long timeout) throws IOException {
  		return getCommandResult(cmdLine, dir, expectedExit, timeout, null);
  	}
docs: Run the given commandline in the given directory and verify that the tool
  has the expected exit code and does finish in the timeout.
  
  Note: The resulting output is stored in memory, running a command
  which prints out a huge amount of data to stdout or stderr will
  cause memory problems.
  
  @param cmdLine The commandline object filled with the executable and command line arguments
  @param dir The working directory for the command
  @param expectedExit The expected exit value or -1 to not fail on any exit value
  @param timeout The timeout in milliseconds or ExecuteWatchdog.INFINITE_TIMEOUT
  @return An InputStream which provides the output of the command.
  
  @throws IOException Execution of sub-process failed or the
  sub-process returned a exit value indicating a failure