I'm a bit confused about the streams... which is which?
Simply, which stream should I use to catch the output of my Process, and which stream should I use to give my Process some input?
I always ignore the names and look at what's returned. If your code has an OutputStream
, you can write to it - which means it's the input for the other process. If your code has an InputStream
, you can read from it - which means it's the output or error for the other process.
Fortunately, the compiler will tell you if you're doing the wrong thing - you've got the data you want to provde, so you've got to write it to the stream, which means it's got to be the OutputStream
.
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