Module java.base
Package java.io

Class LineNumberInputStream

java.lang.Object
java.io.InputStream
java.io.FilterInputStream
java.io.LineNumberInputStream
All Implemented Interfaces:
Closeable, AutoCloseable

@Deprecated public class LineNumberInputStream extends FilterInputStream
Deprecated.
This class incorrectly assumes that bytes adequately represent characters. As of JDK 1.1, the preferred way to operate on character streams is via the new character-stream classes, which include a class for counting line numbers.
This class is an input stream filter that provides the added functionality of keeping track of the current line number.

A line is a sequence of bytes ending with a carriage return character ('\r'), a newline character ('\n'), or a carriage return character followed immediately by a linefeed character. In all three cases, the line terminating character(s) are returned as a single newline character.

The line number begins at 0, and is incremented by 1 when a read returns a newline character.

Since:
1.0
See Also: