LineNumberReader (Java Platform SE 7 ) (original) (raw)


public class LineNumberReader
extends BufferedReader
A buffered character-input stream that keeps track of line numbers. This class defines methods setLineNumber(int) and getLineNumber() for setting and getting the current line number respectively.
By default, line numbering begins at 0. This number increments at everyline terminator as the data is read, and can be changed with a call to setLineNumber(int). Note however, thatsetLineNumber(int) does not actually change the current position in the stream; it only changes the value that will be returned bygetLineNumber().
A line is considered to be terminated by any one of a line feed ('\n'), a carriage return ('\r'), or a carriage return followed immediately by a linefeed.
Since:
JDK1.1

Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2020, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.