Class AbstractMessageParser<T extends HttpMessage>

    • Method Detail

      • fillBuffer

        public int fillBuffer​(java.nio.channels.ReadableByteChannel channel)
                       throws java.io.IOException
        Description copied from interface: NHttpMessageParser
        Fills the internal buffer of the parser with input data from the given ReadableByteChannel.
        Specified by:
        fillBuffer in interface NHttpMessageParser<T extends HttpMessage>
        Parameters:
        channel - the input channel
        Returns:
        number of bytes read.
        Throws:
        java.io.IOException - in case of an I/O error.
      • parse

        public T parse()
                throws java.io.IOException,
                       HttpException
        Description copied from interface: NHttpMessageParser
        Attempts to parse a complete message head from the content of the internal buffer. If the message in the input buffer is incomplete this method will return null.
        Specified by:
        parse in interface NHttpMessageParser<T extends HttpMessage>
        Returns:
        HTTP message head, if available, null otherwise.
        Throws:
        java.io.IOException - in case of an I/O error.
        HttpException - in case the HTTP message is malformed or violates the HTTP protocol.