Package org.im4java.process
Class Pipe
java.lang.Object
org.im4java.process.Pipe
- All Implemented Interfaces:
ErrorConsumer,InputProvider,OutputConsumer
This class implements a pipe. Useful for piping input to a process
or piping output/error from a process to other streams.
You can use the same Pipe-object for both ends of a process-pipeline. But you cannot use the same Pipe-object as an OutputConsumer and ErrorConsumer at the same time.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconsumeError(InputStream pInputStream) The ErrorConsumer must read the error of a process from the given InputStream.voidconsumeOutput(InputStream pInputStream) The OutputConsumer must read the output of a process from the given InputStream.voidprovideInput(OutputStream pOutputStream) The InputProvider must write the input to the given OutputStream.
-
Field Details
-
BUFFER_SIZE
public static final int BUFFER_SIZEDefault buffer size of the pipe. Currently 64KB.- See Also:
-
-
Constructor Details
-
Pipe
Constructor. At least one of the arguments should not be null.
-
-
Method Details
-
provideInput
The InputProvider must write the input to the given OutputStream.- Specified by:
provideInputin interfaceInputProvider- Throws:
IOException
-
consumeOutput
The OutputConsumer must read the output of a process from the given InputStream.- Specified by:
consumeOutputin interfaceOutputConsumer- Throws:
IOException
-
consumeError
The ErrorConsumer must read the error of a process from the given InputStream.- Specified by:
consumeErrorin interfaceErrorConsumer- Throws:
IOException
-