Java ProcessBuilder: Input/OutStream
===

everybody.
    I want to invoke an external program in java code, then the Google tell me that the Runtime or ProcessBuilder can help me do this work. I have tried it, and there come out a problem the java program can't exit, that means both the sub process and the father process wait for forever. they are hanging or deadlock. 

    someone tell me the reason is that the sub process's cache is too small. when it try to give back data to the father process, but the father process don't read it in time, then both of them hang. so they advice me fork an thread to be in charge of read sub process's cache data. I do it as what they say, but there still some problem. 

   Then I close the output stream which get by the method getOutputStream(). Finally, the program success. But I don't know why it happen? Is there some relationship between the output steam and input stream?