org.apache.hc.core5.http.nio

## Interface NHttpMessageParser<T extends MessageHeaders>

- All Known Implementing Classes:
    AbstractMessageParser, DefaultHttpRequestParser, DefaultHttpResponseParser

      public interface NHttpMessageParser<T extends MessageHeaders>

  Message parser intended to build HTTP message head from a session input buffer..
  Since:
    4.0

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `T` | `parse(SessionInputBuffer buffer, boolean endOfStream)` Attempts to parse a complete message head from the content of the internal buffer.
    `void` | `reset()` Resets the parser.

- - ### Method Detail

    - #### reset

          void reset()

      Resets the parser. The parser will be ready to start parsing another HTTP message.

    - #### parse

          T parse(SessionInputBuffer buffer,
                boolean endOfStream)
                                         throws IOException,
                                                HttpException

      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`.
      Parameters:
        `buffer` - session input buffer.
        `endOfStream` - end of stream flag
      Returns:
        HTTP message head, if available, `null` otherwise.
      Throws:
        `IOException` - in case of an I/O error.
        `HttpException` - in case the HTTP message is malformed or violates the HTTP protocol.

Copyright © 2005–2020 The Apache Software Foundation. All rights reserved.