buf.append("a3,b3,c3\r");
buf.append("a4,b4,c4");
StringReader reader = new StringReader(buf.toString());
CSVSerializer serializer = new CSVSerializer();
serializer.setKeys("A", "B", "C");
serializer.getCSVSerializerListeners().add(new CSVSerializerListener() {
public void beginList(CSVSerializer csvSerializer, List<?> list) {
System.out.println("Begin list: " + list);
}
public void endList(CSVSerializer csvSerializer) {
System.out.println("End list");
}
public void readItem(CSVSerializer csvSerializer, Object item) {
System.out.println("Read item: " + item);
}
});
List<?> result = serializer.readObject(reader);
Dictionary<String, Object> row;
// Test the first row
row = (Dictionary<String, Object>)result.get(0);