I am trying to read from two different input streams (stdin and stderr of a child application) and print them in one combined frame. I have never done this before, and I'm curious about best practices.
I can create two threads and let them block the input stream. Is there a better way?
Thank!
Your approach is great, although if you are trying to combine two streams, you may run into problems when mixing output / error.
, Apache commons-exec, /. , , , InputStream (s).
, .
I think your best strategy would be to use classes in the java.nio package. Check this example out.
Source: https://habr.com/ru/post/1756284/More articles:Перенаправить вывод ответа с помощью VBScript в ASP classic - vbscriptОтладка iPhone: получить черный экран при отладке универсального приложения - debuggingSending a message in a C # Windows application - c #Unable to set Response object in ASP Classic - asp-classicWhat is the internal structure of the XML Builder XML file? - iphoneSVN check / commit error - svnbold text in textarea - javascriptTXT records in dnsPython - dnsWhat is the inverse display function when processing images? - image-processingCan anyone recommend a DataMatrix decoding library? - .netAll Articles