@Test
public void testCount() throws Exception {
StringWriter sWriter = new StringWriter();
TextualVectorWriter writer = new TextualVectorWriter(sWriter) {
@Override
public void write(Vector vector) throws IOException {
String vecStr = VectorHelper.vectorToCSVString(vector, false);
getWriter().write(vecStr);
}
};
try {
Iterable<Vector> iter = new RandomVectorIterable(50);
writer.write(iter);
} finally {
Closeables.close(writer, false);
}
Iterator<Vector> csvIter = new CSVVectorIterator(new StringReader(sWriter.getBuffer().toString()));
int count = 0;