com.android.sdklib.util
Class GrabProcessOutput

java.lang.Object
  extended by com.android.sdklib.util.GrabProcessOutput

public class GrabProcessOutput
extends java.lang.Object


Nested Class Summary
static interface GrabProcessOutput.IProcessOutput
           
static class GrabProcessOutput.Wait
           
 
Constructor Summary
GrabProcessOutput()
           
 
Method Summary
static int grabProcessOutput(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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GrabProcessOutput

public GrabProcessOutput()
Method Detail

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.