title: Can't get stdin to read into array on linux - Java
body: <p>So I'm using Java on a Linux machine and I currently am trying to read from stdin so that when I run "java Simulation more ~test/locationOfInput/test" it takes a stream of numbers and calculates values and prints them. However, my code is locking up when trying to read in the values and I have a check for empty files so I know it's at least receiving the file. I currently have this code to read the stdin into an array</p>
  
  <pre><code>    Scanner input = new Scanner(System.in);
      ArrayList&lt;Integer&gt; values = new ArrayList&lt;Integer&gt;();
  
      while (input.hasNextInt()) {
          int i = input.nextInt();
          values.add(i);
      }
  </code></pre>
  
  <p>The loop seems to be running infinitely and I'm not sure why. Am I misunderstanding how to read in from STDIN?</p>