Here you can find the source of loadIntArray(Scanner reader)
public static int[] loadIntArray(Scanner reader)
//package com.java2s; //License from project: Open Source License import java.io.BufferedReader; import java.io.IOException; import java.util.Scanner; public class Main { public static int[] loadIntArray(Scanner reader) { int dim = reader.nextInt(); int[] ret = new int[dim]; for (int i = 0; i < dim; i++) { ret[i] = Integer.parseInt(reader.next()); }/*from www .j av a2s . c o m*/ return ret; } public static int[] loadIntArray(BufferedReader in) { try { int dim = Integer.parseInt(in.readLine()); String[] vals = in.readLine().split("\\s+"); int[] ret = new int[dim]; for (int i = 0; i < ret.length; i++) { ret[i] = Integer.parseInt(vals[i]); } return ret; } catch (IOException e) { throw new RuntimeException(e); } } }