public class CSVParser extends Object implements Closeable
| Constructor and Description |
|---|
CSVParser(InputStream inputStream,
String charset)
Constructor for a parser that reads lines from an InputStream
|
CSVParser(String string)
Constructor for a parser that reads lines from a String
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
String |
currentLine()
Returns the unparsed current line of text
|
boolean |
nextRow()
Advances to the next line of CSV data, if any, skipping any remaining
values on the current row
|
String |
nextToken()
Reads the next value from the current line
|
String[] |
nextTokens()
Returns an array of all values from the next line of the input
|
public CSVParser(InputStream inputStream, String charset) throws IOException
inputStream - The InputStream to read fromcharset - The charset of the InputStreamIOExceptionpublic CSVParser(String string)
string - The string to read frompublic boolean nextRow()
throws IOException
true if a line was read; false othewiseIOExceptionpublic String nextToken()
public String[] nextTokens() throws IOException
IOExceptionpublic String currentLine()
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOException