# JseProcess (Luaj API)
Date: 2015-04-29

## org.luaj.vm2.lib.jse
Class JseProcess

    java.lang.Object
      org.luaj.vm2.lib.jse.JseProcess

    public class JseProcess

extends java.lang.Object

Analog of Process that pipes input and output to client-specified streams.

Constructor Summary
`JseProcess(java.lang.String[] cmd, java.io.InputStream stdin, java.io.OutputStream stdout, java.io.OutputStream stderr)` Construct a process around a command, with specified streams to redirect input and output to.
`JseProcess(java.lang.String cmd, java.io.InputStream stdin, java.io.OutputStream stdout, java.io.OutputStream stderr)` Construct a process around a command, with specified streams to redirect input and output to.

Method Summary
`int` `exitValue()` Get the exit value of the process.
`int` `waitFor()` Wait for the process to complete, and all pending output to finish.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### JseProcess

    public JseProcess(java.lang.String[] cmd,
                      java.io.InputStream stdin,
                      java.io.OutputStream stdout,
                      java.io.OutputStream stderr)
               throws java.io.IOException

  Construct a process around a command, with specified streams to redirect input and output to.

  Parameters:
    `cmd` - The command to execute, including arguments, if any
    `stdin` - Optional InputStream to read from as process input, or null if input is not needed.
    `stdout` - Optional OutputStream to copy process output to, or null if output is ignored.
    `stderr` - Optinoal OutputStream to copy process stderr output to, or null if output is ignored.
  Throws:
    `java.io.IOException` - If the system process could not be created.
  See Also:
    `Process`

### JseProcess

    public JseProcess(java.lang.String cmd,
                      java.io.InputStream stdin,
                      java.io.OutputStream stdout,
                      java.io.OutputStream stderr)
               throws java.io.IOException

  Construct a process around a command, with specified streams to redirect input and output to.

  Parameters:
    `cmd` - The command to execute, including arguments, if any
    `stdin` - Optional InputStream to read from as process input, or null if input is not needed.
    `stdout` - Optional OutputStream to copy process output to, or null if output is ignored.
    `stderr` - Optinoal OutputStream to copy process stderr output to, or null if output is ignored.
  Throws:
    `java.io.IOException` - If the system process could not be created.
  See Also:
    `Process`

Method Detail

### exitValue

    public int exitValue()

  Get the exit value of the process.

### waitFor

    public int waitFor()
                throws java.lang.InterruptedException

  Wait for the process to complete, and all pending output to finish.

  Returns:
    The exit status.
  Throws:
    `java.lang.InterruptedException`

Copyright © 2007-2015 Luaj.org. All Rights Reserved.