L
L
Loligan2016-11-06 22:12:12
Java
Loligan, 2016-11-06 22:12:12

Why can't I work with more than 255 elements received from BufferedReader?

I can't process more than 255 records (there are about 20.000 in the file), as a result, an exception occurs:
java.lang.ArrayIndexOutOfBoundsException
But I can just count the elements for example in checked by writing SUM ++ and everything will work fine, I can't work only with the elements themselves. How to be*?

BufferedReader br = null;
....
....
 br = new BufferedReader(new FileReader(csvFile), 4096);
  br.readLine();
            while ((line = br.readLine()) != null) {
...
  String[] people = line.split(cvsSplitBy);
 checked(people);
...

}

 public static void checked(String[] r) {
        if(r[4]!="")
        TOTAL++;
    }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
al_gon, 2016-11-06
@Loligan

At first glance, the symptoms are that you do not have 4 columns in each row.
Try to debug here String[] people = line.split(cvsSplitBy);.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question