public static void read(Reader reader,CsvProcessor processor) throws NestedIOException { CSVParser parser = null; try{ parser = new CSVParser(reader, DEFAULT_FORMAT); String[] row; int rownum = 0; while((row = parser.nextRecord1()) != null){ rownum++; processor.process(rownum,row); } }catch(IOException e){ throw Exceptions.wrap(e); }catch(Exception e){ throw Exceptions.uncheck(e); }finally{ IO.close(reader); IO.close(parser); } }