Class LineReader

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class LineReader
    extends java.io.FilterInputStream
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected int _charsRead  
      private static int MAX_LEN  
      • Fields inherited from class java.io.FilterInputStream

        in
    • Constructor Summary

      Constructors 
      Constructor Description
      LineReader​(java.io.InputStream is)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getCharsRead()  
      java.io.InputStream getInputStream()  
      java.lang.String readLine()  
      protected java.lang.String readLine​(java.io.InputStream in)
      Read a line of text from the given Stream and return it as a String.
      • Methods inherited from class java.io.FilterInputStream

        available, close, mark, markSupported, read, read, read, reset, skip
      • Methods inherited from class java.io.InputStream

        nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
      • Methods inherited from class java.lang.Object

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

      • _charsRead

        protected int _charsRead
    • Constructor Detail

      • LineReader

        public LineReader​(java.io.InputStream is)
    • Method Detail

      • getInputStream

        public java.io.InputStream getInputStream()
      • getCharsRead

        public int getCharsRead()
      • readLine

        public java.lang.String readLine()
                                  throws java.io.IOException
        Throws:
        java.io.IOException
      • readLine

        protected java.lang.String readLine​(java.io.InputStream in)
                                     throws java.io.IOException
        Read a line of text from the given Stream and return it as a String. Assumes lines end in CRLF.
        Parameters:
        in - a connected stream which contains the entire message being sen.
        Returns:
        the next line read from the stream.
        Throws:
        java.io.IOException - if a connection fails or abnormal connection termination.