I'm using Ubuntu 16.04.
To execute some logic I need to start a process in Java as
String[] commandLine;
String[] environment;
//...
Process p = Runtime.getRuntime().exec(commandLine, environment);
InputStream processInputStream = p.getInputStream(); //<---- ?
But since JVM and the process are different ones I need to understand how they actually communicate. And through what (channels, sockets tcp/udp, pipes, or something else).
How does they actually transfer data?
ProcessBuilder's.inheritIO()method?Process.getInputStream()specifically? That method usually corresponds to the operating system construct that is exposed by the platform's C runtime as thestdoutof the child process. On Linux or any POSIX-compliant system it will be a pipe.