I have a program which needs to store data from text files (comprising of several Mb). I am storing this data into a number of arrays.
To do so, I am currently reading these files once to get the number of lines so that I can get the array length that will be required.
I am then reading the file again and storing this data as the file reader read line by line.
Is there is anything else other than arrays I can use which would mean I dont have to read the file twice? In addition, creating these large arrays are giving me the OutOfMemory heap problem.
Okay, let's not waste people's time by having the same conversation twice. The other thread seems to have more info, so I'll close this one. Followups can go here please.