Package com.android.utils
Class GrabProcessOutput
- java.lang.Object
-
- com.android.utils.GrabProcessOutput
-
public class GrabProcessOutput extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceGrabProcessOutput.IProcessOutputstatic classGrabProcessOutput.Wait
-
Constructor Summary
Constructors Constructor Description GrabProcessOutput()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intgrabProcessOutput(java.lang.Process process, GrabProcessOutput.Wait waitMode, GrabProcessOutput.IProcessOutput output)Get the stderr/stdout outputs of a process and return when the process is done.
-
-
-
Method Detail
-
grabProcessOutput
public static int grabProcessOutput(@NonNull java.lang.Process process, GrabProcessOutput.Wait waitMode, @Nullable GrabProcessOutput.IProcessOutput output) throws java.lang.InterruptedExceptionGet 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- ifProcess.waitFor()was interrupted.
-
-