Package cx.ath.matthew.io
Class ExecOutputStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
cx.ath.matthew.io.ExecOutputStream
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
Class to pipe an OutputStream through a command using stdin/stdout.
E.g.
Writer w = new OutputStreamWriter(new ExecOutputStream(new FileOutputStream("file"), "command"));
-
Field Summary
Fields inherited from class java.io.FilterOutputStream
out
-
Constructor Summary
ConstructorsConstructorDescriptionExecOutputStream
(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
Methods inherited from class java.io.OutputStream
nullOutputStream
-
Constructor Details
-
ExecOutputStream
Create a new ExecOutputStream on the given OutputStream using the process to filter the stream.- Parameters:
os
- Writes to this OutputStreamp
- Filters data through stdin/out on this Process- Throws:
IOException
-
ExecOutputStream
Create a new ExecOutputStream on the given OutputStream using the process to filter the stream.- Parameters:
os
- Writes to this OutputStreamcmd
- Creates a Process from this string to filter data through stdin/out- Throws:
IOException
-
ExecOutputStream
Create a new ExecOutputStream on the given OutputStream using the process to filter the stream.- Parameters:
os
- Writes to this OutputStreamcmd
- Creates a Process from this string array (command, arg, ...) to filter data through stdin/out- Throws:
IOException
-
ExecOutputStream
Create a new ExecOutputStream on the given OutputStream using the process to filter the stream.- Parameters:
os
- Writes to this OutputStreamcmd
- Creates a Process from this string to filter data through stdin/outenv
- Setup the environment for the command- Throws:
IOException
-
ExecOutputStream
Create a new ExecOutputStream on the given OutputStream using the process to filter the stream.- Parameters:
os
- Writes to this OutputStreamcmd
- Creates a Process from this string array (command, arg, ...) to filter data through stdin/outenv
- Setup the environment for the command- Throws:
IOException
-
-
Method Details
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classFilterOutputStream
- Throws:
IOException
-
flush
- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classFilterOutputStream
- Throws:
IOException
-
write
- Overrides:
write
in classFilterOutputStream
- Throws:
IOException
-
write
- Overrides:
write
in classFilterOutputStream
- Throws:
IOException
-
write
- Overrides:
write
in classFilterOutputStream
- Throws:
IOException
-
finalize
public void finalize()
-