Class LineReaderInputStream

    • Field Summary

      • Fields inherited from class java.io.FilterInputStream

        in
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected LineReaderInputStream​(java.io.InputStream in)  
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      abstract int readLine​(ByteArrayBuffer dst)
      Reads one line of text into the given ByteArrayBuffer.
      abstract boolean unread​(ByteArrayBuffer buf)
      Tries to unread the last read line.
      abstract boolean unread​(RecycledByteArrayBuffer buf)  
      • 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
    • Constructor Detail

      • LineReaderInputStream

        protected LineReaderInputStream​(java.io.InputStream in)
    • Method Detail

      • readLine

        public abstract int readLine​(ByteArrayBuffer dst)
                              throws MaxLineLimitException,
                                     java.io.IOException
        Reads one line of text into the given ByteArrayBuffer.
        Parameters:
        dst - Destination
        Returns:
        number of bytes copied or -1 if the end of the stream has been reached.
        Throws:
        MaxLineLimitException - if the line exceeds a limit on the line length imposed by a subclass.
        java.io.IOException - in case of an I/O error.
      • unread

        public abstract boolean unread​(ByteArrayBuffer buf)
        Tries to unread the last read line. Implementation may refuse to unread a new buffer until the previous unread one has been competely consumed. Implementations will directly use the byte array backed by buf, so make sure to not alter it anymore once this method has been called.
        Returns:
        true if the unread has been succesfull.