// We read data from input stream one line at a time until we
// reach end of file. Each line is parsed to extract data used
// to construct Country objects.
for (;;) {
try {
final String line = new String(lineReader.readLine());
// Parse the current line.
final int comma1 = line.indexOf(',');
final String country = line.substring(0, comma1);
final int comma2 = line.indexOf(',', comma1 + 1);