cx.ath.matthew.io

Class ExecOutputStream

public class ExecOutputStream extends FilterOutputStream

Class to pipe an OutputStream through a command using stdin/stdout. E.g.
    Writer w = new OutputStreamWriter(new ExecOutputStream(new FileOutputStream("file"), "command"));
 
Constructor Summary
ExecOutputStream(OutputStream os, Process p)
Create a new ExecOutputStream on the given OutputStream using the process to filter the stream.
ExecOutputStream(OutputStream os, String cmd)
Create a new ExecOutputStream on the given OutputStream using the process to filter the stream.
ExecOutputStream(OutputStream os, String[] cmd)
Create a new ExecOutputStream on the given OutputStream using the process to filter the stream.
ExecOutputStream(OutputStream os, String cmd, String[] env)
Create a new ExecOutputStream on the given OutputStream using the process to filter the stream.
ExecOutputStream(OutputStream os, String[] cmd, String[] env)
Create a new ExecOutputStream on the given OutputStream using the process to filter the stream.
Method Summary
voidclose()
voidfinalize()
voidflush()
voidwrite(byte[] b)
voidwrite(byte[] b, int off, int len)
voidwrite(int b)

Constructor Detail

ExecOutputStream

public ExecOutputStream(OutputStream os, Process p)
Create a new ExecOutputStream on the given OutputStream using the process to filter the stream.

Parameters: os Writes to this OutputStream p Filters data through stdin/out on this Process

ExecOutputStream

public ExecOutputStream(OutputStream os, String cmd)
Create a new ExecOutputStream on the given OutputStream using the process to filter the stream.

Parameters: os Writes to this OutputStream cmd Creates a Process from this string to filter data through stdin/out

ExecOutputStream

public ExecOutputStream(OutputStream os, String[] cmd)
Create a new ExecOutputStream on the given OutputStream using the process to filter the stream.

Parameters: os Writes to this OutputStream cmd Creates a Process from this string array (command, arg, ...) to filter data through stdin/out

ExecOutputStream

public ExecOutputStream(OutputStream os, String cmd, String[] env)
Create a new ExecOutputStream on the given OutputStream using the process to filter the stream.

Parameters: os Writes to this OutputStream cmd Creates a Process from this string to filter data through stdin/out env Setup the environment for the command

ExecOutputStream

public ExecOutputStream(OutputStream os, String[] cmd, String[] env)
Create a new ExecOutputStream on the given OutputStream using the process to filter the stream.

Parameters: os Writes to this OutputStream 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

close

public void close()

finalize

public void finalize()

flush

public void flush()

write

public void write(byte[] b)

write

public void write(byte[] b, int off, int len)

write

public void write(int b)