java.io 
Class LineNumberReader
java.io 
Class BufferedReader
java.lang.Object
  |
  +--java.io.Reader
        |
        +--java.io.BufferedReaderDirect Known Subclasses: 
LineNumberReader --------------------------------------------------------------------------------public class BufferedReader
extends Reader
Read text from a character-input stream, buffering characters so as to provide for the efficient reading of characters, arrays, and lines. The buffer size may be specified, or the default size may be used. The default is large enough for most purposes. In general, each read request made of a Reader causes a corresponding read request to be made of the underlying character or byte stream. It is therefore advisable to wrap a BufferedReader around any Reader whose read() operations may be costly, such as FileReaders and InputStreamReaders. For example,  BufferedReader in
   = new BufferedReader(new FileReader("foo.in"));
 
will buffer the input from the specified file. Without buffering, each invocation of read() or readLine() could cause bytes to be read from the file, converted into characters, and then returned, which can be very inefficient. 
Programs that use DataInputStreams for textual input can be localized by replacing each DataInputStream with an appropriate BufferedReader. 
java.lang.Object
  |
  +--java.io.Reader
        |
        +--java.io.BufferedReader
              |
              +--java.io.LineNumberReader
--------------------------------------------------------------------------------public class LineNumberReader
extends BufferedReader
A buffered character-input stream that keeps track of line numbers. 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. 

解决方案 »

  1.   

    java.io 
    Class BufferedReaderjava.lang.Object
      |
      +--java.io.Reader
            |
            +--java.io.BufferedReaderDirect Known Subclasses: 
    LineNumberReader --------------------------------------------------------------------------------public class BufferedReader
    extends Reader
    Read text from a character-input stream, buffering characters so as to provide for the efficient reading of characters, arrays, and lines. The buffer size may be specified, or the default size may be used. The default is large enough for most purposes. In general, each read request made of a Reader causes a corresponding read request to be made of the underlying character or byte stream. It is therefore advisable to wrap a BufferedReader around any Reader whose read() operations may be costly, such as FileReaders and InputStreamReaders. For example,  BufferedReader in
       = new BufferedReader(new FileReader("foo.in"));
     
    will buffer the input from the specified file. Without buffering, each invocation of read() or readLine() could cause bytes to be read from the file, converted into characters, and then returned, which can be very inefficient. 
    Programs that use DataInputStreams for textual input can be localized by replacing each DataInputStream with an appropriate BufferedReader. java.io 
    Class LineNumberReaderjava.lang.Object
      |
      +--java.io.Reader
            |
            +--java.io.BufferedReader
                  |
                  +--java.io.LineNumberReader
    --------------------------------------------------------------------------------public class LineNumberReader
    extends BufferedReader
    A buffered character-input stream that keeps track of line numbers. 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. 
      

  2.   

    LineNumberReader.readLine()重载了BufferedReader.readLine()吗?他们有什么区别呢?
    楼上的光把API的东东打出来了,没有实质性的说明啊.up