title: Java and stdin vs a file
body: <p>I have to do this assignment but the thing says "All the programs should take input from STANDARD INPUT, not from a file." , this is fine to ask advice on, but what does this mean?</p>
  
  <p>I was doing the code below but then someone said this is not correct, that its as if someone typed on the cmdline not a redirection from a file. I'm confused here, how do I do this so its stops when whoever tests my code gives it data, of while I don't know how they will other than stdin? Thanks, the data gets rather large like 500k.</p>
  
  <pre><code>    List&lt;Double&gt; list = new ArrayList&lt;Double&gt;();
  
      /*
       * Get the data from the stdin and read into a buffer until its done.
       */
      BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
      String s;
      try {
          while ((s = in.readLine()) != null &amp;&amp; s.length() != 0) {
              double myReal = Double.parseDouble(s);
              // System.out.println(myReal);
              list.add(myReal);
              // System.out.println(s);
          }
      } catch (IOException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      }
  </code></pre>