grabProcessOutput
public static int grabProcessOutput(@NonNull
java.lang.Process process,
GrabProcessOutput.Wait waitMode,
@Nullable
GrabProcessOutput.IProcessOutput output)
throws java.lang.InterruptedException
Get the stderr/stdout outputs of a process and return when the process is done.
Both must be read or the process will block on windows.
- Parameters:
process
- The process to get the output from.
output
- Optional object to capture stdout/stderr.
Note that on Windows capturing the output is not optional. If output is null
the stdout/stderr will be captured and discarded.
waitMode
- Whether to wait for the process and/or the readers to finish.
- Returns:
- the process return code.
- Throws:
java.lang.InterruptedException
- if Process.waitFor()
was interrupted.