diff --git a/src/main/java/org/apache/commons/csv/Lexer.java b/src/main/java/org/apache/commons/csv/Lexer.java index 49e946f8..ca49346b 100644 --- a/src/main/java/org/apache/commons/csv/Lexer.java +++ b/src/main/java/org/apache/commons/csv/Lexer.java @@ -111,6 +111,16 @@ abstract class Lexer { return (c == '\n' || c == '\r'); } + /** + * Checks if the current character represents the start of a line: + * a CR, LF or is at the start of the file. + * + * @param c + * @return true if the character is at the start of a line. + */ + boolean isStartOfLine(int c) { + return c == '\n' || c == '\r' || c == ExtendedBufferedReader.UNDEFINED; + } /** * @return true if the given character indicates end of file */