I'm trying to run a program ignoring its output, but it seems to hangs when its output is large. My code is as follows:
Process p = Runtime.getRuntime().exec("program");
p.getOutputStream().write(input.getBytes());
p.getOutputStream().flush();
p.getOutputStream().close();
p.waitFor();
What is the best way to ignore the output?
I tried to redirect the output to /dev/null, but I got a Java IOException 'Broke pipe'.