/** * Reads a record info from the database. A record is represented by a complete line in the CSV formatted text * file. * <p/> * Leading and trailing whitespaces removed from each column value. For empty lines, the method returns an * array of the length zero. The method returns <code>null</code> if the end of file has been reached. * * @return a record containing the tokens delimited by the separator character passed to the constructor * @throws IOException if an I/O error occurs */ public String[] readRecord() throws IOException { while (true) { String line = readLine(); if (line == null) { return null; } else if (getCommentPrefix() == null || !line.startsWith(getCommentPrefix())) { String[] record = split(line); if (record.length != 0 || !ignoresEmptyLines()) { return record; } } } }