Name
Process
Synopsis
This class
describes a process that is running externally to the Java
interpreter. Note that a Process is very different
from a Thread; the Process
class is abstract and cannot be instantiated. Call one of the
Runtime.exec( ) methods to start a process and
return a corresponding Process object.
waitFor( ) blocks until the
process exits. exitValue( ) returns the exit code
of the process. destroy( ) kills the process.
getErrorStream(
)
returns
an
InputStream from which you can read any bytes the
process sends to its standard error stream. getInputStream(
) returns an InputStream from which you
can read any bytes the process sends to its standard output stream.
getOutputStream( ) returns an
OutputStream you can use to send bytes to the
standard input stream of the process.
public abstract class Process { // Public Constructors public Process( ); // Public Instance Methods public abstract void destroy( ); public abstract int exitValue( ); public abstract java.io.InputStream getErrorStream( ); public abstract java.io.InputStream getInputStream( ); public abstract java.io.OutputStream getOutputStream( ); public abstract int waitFor( ) throws InterruptedException; }
Returned By
ProcessBuilder.start( ), Runtime.exec(
)
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access