Csv { public static List<String> readRow(final String row) throws CsvParseException { try { return readRow(new StringReader(row)); } catch (IOException ex) { throw new UncheckedIOException(ex); } } private  Csv(); static String[] readSystemProperty(final String propertyName, final String... defaults); static void writeCsvRow(final Appendable writer, final Object... elems); static void writeCsvRow2(final Appendable writer, final Object obj, final Object... elems); static void writeCsvRow(final Appendable writer, final long... elems); static void writeCsvRowNoEOL(final long[] elems, final Appendable writer); static void writeCsvRow(final Appendable writer, final Iterable<?> elems); static void writeCsvRowNoEOL(final Iterable<?> elems, final Appendable writer); static T read(final File file, final Charset charset,
          final CsvMapHandler<T> handler); static T read(final File file, final Charset charset,
          final CsvHandler<T> handler); static List<Map<String, String>> read(final Reader preader); static T read(final Reader preader,
          final CsvMapHandler<T> handler); static List<String> readRow(final String row); static List<String> readRow(final Reader reader); static T readRow(final Reader reader, final CsvRowHandler<T> handler); static T read(final Reader preader,
          final CsvHandler<T> handler); static T readNoBom(final PushbackReader reader, final CsvHandler<T> handler); static Iterable<Iterable<String>> asIterable(final Reader preader); static CsvReader reader(final Reader preader); static CsvReader readerNoBOM(final PushbackReader reader); static void writeCsvElement(final CharSequence elem, final Appendable writer); static void writeQuotedCsvElement(final CharSequence elem, final Appendable writer); static CharSequence toCsvElement(final CharSequence elem); @CheckReturnValue static int readCsvElement(final Reader reader, final StringBuilder addElemTo); static final CharSeparatedValues CSV; }
@Test public void testReadRow() throws IOException, CsvParseException { List<String> row = Csv.readRow(new StringReader("a,b,\",c\",d")); Assert.assertEquals("a", row.get(0)); }
@Test public void testCsvRowParsing() throws IOException, CsvParseException { List<String> readRow = Csv.readRow(new StringReader("")); Assert.assertEquals(Collections.singletonList(""), readRow); }
@Test public void testCsvRowParsing2() throws IOException, CsvParseException { List<String> readRow = Csv.readRow(CharSource.wrap("").openStream()); Assert.assertEquals(Collections.singletonList(""), readRow); }