title: Can't understand use of input stream and output stream
body: <p>I am confused regarding use of input stream and output stream. From a stack overflow question  <a href="https://stackoverflow.com/questions/3385201/confused-about-stdin-stdout-and-stderr">confused about stdin, stdout and stderr?</a> :</p>
  
  <p><strong>Standard input</strong> - this is the file handle that your process reads to get information from you.</p>
  
  <p><strong>Standard output</strong> - your process writes normal information to this file handle.</p>
  
  <p>I was trying to run an external process(A python script) using java.Which is an interactive one and requires input from user.</p>
  
  <p>Now as concept says that:</p>
  
  <blockquote>
    <p>standard input is used when your process reads to get information from
    you.</p>
  </blockquote>
  
  <p>So I should get input stream from the process to write values to it.I tried to it and failed .So I searched on stack overflow gave me a question with same problem  which was taking output stream from process and then was writing to it.I tried that and that worked.</p>
  
  <p>My question is that why that worked? Shouldn't it be input stream which I should use to give input to that external process or I have understood input stream and output stream totally wrong.</p>
  
  <p>Please help me to understand it with an easy explanation .</p>
  
  <p>Edit : My code was :</p>
  
  <pre><code> Process process=Runtime.getRuntime().exec("/usr/bin/python /home/abhijeet/test.py");
      OutputStream  stdin = process.getOutputStream ();
      String line = "30" + "\n";
      stdin.write(line.getBytes() );
  </code></pre>