cx.ath.matthew.io

Class ExecInputStream

public class ExecInputStream extends FilterInputStream

Class to pipe an InputStream through a command using stdin/stdout. E.g.
    Reader r = new InputStreamReader(new ExecInputStream(new FileInputStream("file"), "command"));
 
Constructor Summary
ExecInputStream(InputStream is, Process p)
Create a new ExecInputStream on the given InputStream using the process to filter the stream.
ExecInputStream(InputStream is, String cmd)
Create a new ExecInputStream on the given InputStream using the process to filter the stream.
ExecInputStream(InputStream is, String[] cmd)
Create a new ExecInputStream on the given InputStream using the process to filter the stream.
ExecInputStream(InputStream is, String cmd, String[] env)
Create a new ExecInputStream on the given InputStream using the process to filter the stream.
ExecInputStream(InputStream is, String[] cmd, String[] env)
Create a new ExecInputStream on the given InputStream using the process to filter the stream.
Method Summary
intavailable()
voidclose()
voidfinalize()
voidflush()
voidmark(int readlimit)
booleanmarkSupported()
intread()
intread(byte[] b)
intread(byte[] b, int off, int len)
voidreset()
longskip(long n)

Constructor Detail

ExecInputStream

public ExecInputStream(InputStream is, Process p)
Create a new ExecInputStream on the given InputStream using the process to filter the stream.

Parameters: is Reads from this InputStream p Filters data through stdin/out on this Process

ExecInputStream

public ExecInputStream(InputStream is, String cmd)
Create a new ExecInputStream on the given InputStream using the process to filter the stream.

Parameters: is Reads from this InputStream cmd Creates a Process from this string to filter data through stdin/out

ExecInputStream

public ExecInputStream(InputStream is, String[] cmd)
Create a new ExecInputStream on the given InputStream using the process to filter the stream.

Parameters: is Reads from this InputStream cmd Creates a Process from this string array (command, arg, ...) to filter data through stdin/out

ExecInputStream

public ExecInputStream(InputStream is, String cmd, String[] env)
Create a new ExecInputStream on the given InputStream using the process to filter the stream.

Parameters: is Reads from this InputStream cmd Creates a Process from this string to filter data through stdin/out env Setup the environment for the command

ExecInputStream

public ExecInputStream(InputStream is, String[] cmd, String[] env)
Create a new ExecInputStream on the given InputStream using the process to filter the stream.

Parameters: is Reads from this InputStream cmd Creates a Process from this string array (command, arg, ...) to filter data through stdin/out env Setup the environment for the command

Method Detail

available

public int available()

close

public void close()

finalize

public void finalize()

flush

public void flush()

mark

public void mark(int readlimit)

markSupported

public boolean markSupported()

read

public int read()

read

public int read(byte[] b)

read

public int read(byte[] b, int off, int len)

reset

public void reset()

skip

public long skip(long n)