Skip to content

Commit c609fb3

Browse files
committed
[CSV-131] Save positions of records to enable random access. 2nd commit for this new feature. Let the Lexer make the underlying reader's character position available through a new package private method.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1625456 13f79535-47bb-0310-9956-ffa450edef68
1 parent 9e4e3dc commit c609fb3

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

src/main/java/org/apache/commons/csv/Lexer.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
import java.io.IOException;
3535

3636
/**
37-
*
37+
* Lexical analyzer.
3838
*
3939
* @version $Id$
4040
*/
@@ -301,6 +301,15 @@ long getCurrentLineNumber() {
301301
return reader.getCurrentLineNumber();
302302
}
303303

304+
/**
305+
* Returns the current character position
306+
*
307+
* @return the current character position
308+
*/
309+
long getCharacterPosition() {
310+
return reader.getPosition();
311+
}
312+
304313
// TODO escape handling needs more work
305314
/**
306315
* Handle an escape sequence.

0 commit comments

Comments
 (0)