Class LineReader


  • @Beta
    public final class LineReader
    extends java.lang.Object
    A class for reading lines of text. Provides the same functionality as BufferedReader.readLine() but for all Readable objects, not just instances of Reader.
    Since:
    1.0
    • Constructor Summary

      Constructors 
      Constructor Description
      LineReader​(java.lang.Readable readable)
      Creates a new instance that will read lines from the given Readable object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String readLine()
      Reads a line of text.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LineReader

        public LineReader​(java.lang.Readable readable)
        Creates a new instance that will read lines from the given Readable object.
    • Method Detail

      • readLine

        public java.lang.String readLine()
                                  throws java.io.IOException
        Reads a line of text. 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 ("\r\n").
        Returns:
        a String containing the contents of the line, not including any line-termination characters, or null if the end of the stream has been reached.
        Throws:
        java.io.IOException - if an I/O error occurs