Package java.lang |
![]() Previous |
![]() Java API |
![]() Index |
![]() Next |
public abstract class java.lang.Process extends java.lang.Object { // Constructors public Process(); // Methods public abstract void destroy(); public abstract int exitValue(); public abstract InputStream getErrorStream(); public abstract InputStream getInputStream(); public abstract OutputStream getOutputStream(); public abstract int waitFor(); }
The exec methods return an instance of a subclass of Process that can be used to control the process and obtain information about it.
The subprocess is not killed when there are no more references to the Process object, but rather the subprocess continues executing asynchronously.
public Process()The default constructor.
public abstract void destroy()Kills the subprocess.
public abstract int exitValue()Return Value:
Returns the exit value of the subprocess.
Throw:
If the subprocess has not yet terminated.
public abstract InputStream getErrorStream()Gets the error stream of the subprocess.
Return Value:
Returns the input stream connected to the error stream of the subprocess. This stream is usually unbuffered.
public abstract InputStream getInputStream()Gets the input stream of the subprocess.
Return Value:
Returns the input stream connected to the normal output of the subprocess. This stream is usually buffered.
public abstract OutputStream getOutputStream()Gets the output stream of the subprocess.
Return Value:
Returns the output stream connected to the normal input of the subprocess. This stream is usually buffered.
public abstract int waitFor()throws InterruptedExceptionWaits for the subprocess to complete. This method returns immediately if the subprocess has already terminated.
Return Value:
Returns the exit value of the process.
Throw:
If the waitFor was interrupted.