All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sfm.csv.parser.CsvParser Maven / Gradle / Ivy

package org.sfm.csv.parser;

import java.io.IOException;
import java.io.Reader;

import org.sfm.utils.RowHandler;

public final class CsvParser {
	
	private final int bufferSize;
	
	public CsvParser(final int bufferSize) {
		this.bufferSize = bufferSize;
	}
	
	public CsvParser() {
		this(1<<16);
	}
		
	public  CH parse(final Reader r, final CH handler) throws IOException {
		new ReaderCsvParser(bufferSize).parse(r, handler);
		return handler;
	}
	
	public > RH readRows(final Reader r, final RH handler) throws IOException {
		new ReaderCsvParser(bufferSize).parse(r, new StringArrayHandler(handler));
		return handler;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy