I am creating a process in Java using the following code:
Process newExec = null; BufferedReader outStream = null; BufferedReader inStream = null; BufferedReader errStream = null; StringBuffer outputBuffer = new StringBuffer(); String PATH_TO_EXEC = config.getExecPath(); try { newExec = Runtime.getRuntime().exec(PATH_TO_EXEC + " " + args); } catch(IOException e){ outputBuffer.append("Error in running executable."); e.printStackTrace(); return outputBuffer.toString(); }
After the process is spawned, it waits for input through stdin. How can I pass strings to this newly created program?
source share