is there a way to retrieve the actual java inputStream that correspond to the stdout of the java process being executed, when using ProcessBuilder or anything else in the package ?
Sure, just "use java":
import java.io.BufferedReader
import java.io.IOException
import java.io.InputStreamReader
object Main {
def main(args: Array[String]) {
var br: BufferedReader = null
try {
br = new BufferedReader(new InputStreamReader(System.in))
while (true) {
val input = br.readLine()
}
} finally {
br.close()
}
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With