@Test public void testParseLine() throws IOException { String[] toks = csvr.readNext(); assertEquals("a", toks[0]); assertEquals("b", toks[1]); assertEquals("c", toks[2]); toks = csvr.readNext(); assertEquals("a", toks[0]); assertEquals("b,b,b", toks[1]); assertEquals("c", toks[2]); toks = csvr.readNext(); assertEquals(3, toks.length); toks = csvr.readNext(); assertEquals(3, toks.length); toks = csvr.readNext(); assertEquals("Glen \"\"The Man\"\" Smith", toks[0]); toks = csvr.readNext(); assertEquals("\"\"\"\"", toks[0]); assertEquals("test", toks[1]); toks = csvr.readNext(); assertEquals(4, toks.length); assertNull(csvr.readNext()); }
public String[] readNext() throws IOException, CsvRecordException { try { while (skipLines > 0) { if (parser.parseNext(br) == null) { skipLines = 0; } else { recordNumber++; skipLines--; } } List<String> next = parser.parseNext(br); if (next == null) { return null; } recordNumber++; return next.toArray(new String[next.size()]); } catch (CsvRecordException re) { CsvRecordException nre = new CsvRecordException(re.getMessage() + ": " + recordNumber + "."); nre.setStackTrace(re.getStackTrace()); throw nre; } }
CsvReader implements Closeable, Iterable<String[]> { public String[] readNext() throws IOException, CsvRecordException { try { while (skipLines > 0) { if (parser.parseNext(br) == null) { skipLines = 0; } else { recordNumber++; skipLines--; } } List<String> next = parser.parseNext(br); if (next == null) { return null; } recordNumber++; return next.toArray(new String[next.size()]); } catch (CsvRecordException re) { CsvRecordException nre = new CsvRecordException(re.getMessage() + ": " + recordNumber + "."); nre.setStackTrace(re.getStackTrace()); throw nre; } } }
CsvReader implements Closeable, Iterable<String[]> { public String[] readNext() throws IOException, CsvRecordException { try { while (skipLines > 0) { if (parser.parseNext(br) == null) { skipLines = 0; } else { recordNumber++; skipLines--; } } List<String> next = parser.parseNext(br); if (next == null) { return null; } recordNumber++; return next.toArray(new String[next.size()]); } catch (CsvRecordException re) { CsvRecordException nre = new CsvRecordException(re.getMessage() + ": " + recordNumber + "."); nre.setStackTrace(re.getStackTrace()); throw nre; } } CsvReader(Reader reader);  CsvReader(Reader reader, int line);  CsvReader(Reader reader, CsvParser csvParser);  CsvReader(Reader reader, int line, CsvParser csvParser); }
CsvReader implements Closeable, Iterable<String[]> { public String[] readNext() throws IOException, CsvRecordException { try { while (skipLines > 0) { if (parser.parseNext(br) == null) { skipLines = 0; } else { recordNumber++; skipLines--; } } List<String> next = parser.parseNext(br); if (next == null) { return null; } recordNumber++; return next.toArray(new String[next.size()]); } catch (CsvRecordException re) { CsvRecordException nre = new CsvRecordException(re.getMessage() + ": " + recordNumber + "."); nre.setStackTrace(re.getStackTrace()); throw nre; } } CsvReader(Reader reader);  CsvReader(Reader reader, int line);  CsvReader(Reader reader, CsvParser csvParser);  CsvReader(Reader reader, int line, CsvParser csvParser); List<String[]> readAll(); String[] readNext(); @Override void close(); @Override Iterator<String[]> iterator(); }
CsvReader implements Closeable, Iterable<String[]> { public String[] readNext() throws IOException, CsvRecordException { try { while (skipLines > 0) { if (parser.parseNext(br) == null) { skipLines = 0; } else { recordNumber++; skipLines--; } } List<String> next = parser.parseNext(br); if (next == null) { return null; } recordNumber++; return next.toArray(new String[next.size()]); } catch (CsvRecordException re) { CsvRecordException nre = new CsvRecordException(re.getMessage() + ": " + recordNumber + "."); nre.setStackTrace(re.getStackTrace()); throw nre; } } CsvReader(Reader reader);  CsvReader(Reader reader, int line);  CsvReader(Reader reader, CsvParser csvParser);  CsvReader(Reader reader, int line, CsvParser csvParser); List<String[]> readAll(); String[] readNext(); @Override void close(); @Override Iterator<String[]> iterator(); static final int DEFAULT_SKIP_LINES; }