title: Java: Most Efficient Way to Get Input Integer Array
body: <p>I'm working on a problem that requires me to store a very large amount of integers into an integer array. The input is formatted so that one line displays the amount of integers and the next displays all of the values meant to be stored. Ex:</p>
  
  <pre><code>3
  12 45 67
  </code></pre>
  
  <p>In the problem there is closer to 100,000 integers to be stored. Currently I am using this method of storing the integers:</p>
  
  <pre><code>Scanner scanner = new Scanner(System.in);
  int n = scanner.nextInt();
  
  int[] iVau = new int[n];
  
  String[] temp = scanner.nextLine().split(" ");
  
  for(int i = 0; i &lt; n; i++) {
      iVau[i] = Integer.parseInt(temp[i]);
  }
  </code></pre>
  
  <p>This works fine, however the problem I am solving has a strict time limit and my current solution is exceeding it. I know that there is a more efficient way to store this input using buffered readers and input streams, but I don't know how to do it, can someone please show me.</p>