Class ProcessStreamConsumer
- java.lang.Object
-
- com.github.toolarium.system.command.process.liveness.impl.ProcessStreamConsumer
-
public class ProcessStreamConsumer extends java.lang.Object
Process stream consumer
-
-
Constructor Summary
Constructors Constructor Description ProcessStreamConsumer(java.io.InputStream source, IProcessOutputStream processOutputStream, java.io.File optionalSourceFile)
Constructor for ProcessStreamConsumer
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
close()
Pipe the available bytes from the source stream to the target.int
pipeAvailableBytes()
Pipe the available bytes from the source stream to the target.java.lang.String
toString()
-
-
-
Constructor Detail
-
ProcessStreamConsumer
public ProcessStreamConsumer(java.io.InputStream source, IProcessOutputStream processOutputStream, java.io.File optionalSourceFile)
Constructor for ProcessStreamConsumer- Parameters:
source
- the input streamprocessOutputStream
- the process output streamoptionalSourceFile
- the optional source file
-
-
Method Detail
-
pipeAvailableBytes
public int pipeAvailableBytes()
Pipe the available bytes from the source stream to the target. In case a prefix is defined it will be inserted after a newline.- Returns:
- the number of piped data; -1 in case of an error
-
close
public boolean close()
Pipe the available bytes from the source stream to the target. In case a prefix is defined it will be inserted after a newline.- Returns:
- true if the available bytes could be copied without errors.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
- See Also:
Object.toString()
-
-