CsvConfiguration.DEFAULT_TRUE_FORMAT,
CsvConfiguration.DEFAULT_FALSE_FORMAT,
CsvConfiguration.DEFAULT_DATE_FORMAT,
CsvConfiguration.DEFAULT_DATE_TIME_FORMAT);
ByteArrayInputStream input = new ByteArrayInputStream(string.getBytes(conf.getCharset()));
CsvParser parser = new CsvParser(input, string, conf);
List<String[]> results = Lists.create();
try {
StringOption buffer = new StringOption();
while (parser.next()) {
String[] line = new String[columns];
for (int i = 0; i < columns; i++) {
parser.fill(buffer);
line[i] = buffer.or((String) null);
}
parser.endRecord();
results.add(line);
}
parser.close();
} catch (Exception e) {
throw new AssertionError(e);
}
return results.toArray(new String[results.size()][]);
}