OutputBuffer
uses a separate thread to read from the standard output stream of the subprocess, and is made available upon reaching the end of the output stream. This class helps avoid potential deadlocks in the subprocess returned from a call to Runtime.exec()
. The exec()
methods in java.lang.Runtime
return a Process
object for managing the subprocess. As mentioned in the documentation for class java.lang.Process
, failure to promptly read the output stream of the subprocess may cause the subprocess to block, and even deadlock.
Use this class to reduce the risk of deadlock even if you don't plan to access contents of the buffer after they become available. @see ProcessBuffer
|
|