< prev index next >
src/java.base/share/classes/java/io/LineNumberReader.java
Print this page
*** 32,45 ****
* #getLineNumber()} for setting and getting the current line number
* respectively.
*
* <p> By default, line numbering begins at 0. This number increments at every
* <a href="#lt">line terminator</a> as the data is read, and can be changed
! * with a call to <tt>setLineNumber(int)</tt>. Note however, that
! * <tt>setLineNumber(int)</tt> does not actually change the current position in
* the stream; it only changes the value that will be returned by
! * <tt>getLineNumber()</tt>.
*
* <p> A line is considered to be <a name="lt">terminated</a> by any one of a
* line feed ('\n'), a carriage return ('\r'), or a carriage return followed
* immediately by a linefeed.
*
--- 32,45 ----
* #getLineNumber()} for setting and getting the current line number
* respectively.
*
* <p> By default, line numbering begins at 0. This number increments at every
* <a href="#lt">line terminator</a> as the data is read, and can be changed
! * with a call to {@code setLineNumber(int)}. Note however, that
! * {@code setLineNumber(int)} does not actually change the current position in
* the stream; it only changes the value that will be returned by
! * {@code getLineNumber()}.
*
* <p> A line is considered to be <a name="lt">terminated</a> by any one of a
* line feed ('\n'), a carriage return ('\r'), or a carriage return followed
* immediately by a linefeed.
*
*** 191,201 ****
* Read a line of text. Whenever a <a href="#lt">line terminator</a> is
* read the current line number is incremented.
*
* @return A String containing the contents of the line, not including
* any <a href="#lt">line termination characters</a>, or
! * <tt>null</tt> if the end of the stream has been reached
*
* @throws IOException
* If an I/O error occurs
*/
public String readLine() throws IOException {
--- 191,201 ----
* Read a line of text. Whenever a <a href="#lt">line terminator</a> is
* read the current line number is incremented.
*
* @return A String containing the contents of the line, not including
* any <a href="#lt">line termination characters</a>, or
! * {@code null} if the end of the stream has been reached
*
* @throws IOException
* If an I/O error occurs
*/
public String readLine() throws IOException {
*** 224,234 ****
*
* @throws IOException
* If an I/O error occurs
*
* @throws IllegalArgumentException
! * If <tt>n</tt> is negative
*/
public long skip(long n) throws IOException {
if (n < 0)
throw new IllegalArgumentException("skip() value is negative");
int nn = (int) Math.min(n, maxSkipBufferSize);
--- 224,234 ----
*
* @throws IOException
* If an I/O error occurs
*
* @throws IllegalArgumentException
! * If {@code n} is negative
*/
public long skip(long n) throws IOException {
if (n < 0)
throw new IllegalArgumentException("skip() value is negative");
int nn = (int) Math.min(n, maxSkipBufferSize);
< prev index next >