Fill an int array with an txt java : Hi i want to fill and array with values from a txt file but i got the error java.util.NoSuchElementException: No line found when running the program, this is my code.

    private static void leeArchivo()
    {
        Scanner s = new Scanner(System.in);
        //Size of the array
        int size = Integer.parseInt(s.nextLine());
        datos = new int[size];
        while (s.hasNextLine()) {
            for (int i = 0; i < size; i++) {
                //fill array with values
                datos[i] = Integer.parseInt(s.nextLine());
            }
        }
    }


the txt would look like this, first element size of the array

4

75

62

32

55