public interface

NHttpMessageParser

org.apache.http.nio.NHttpMessageParser<T extends org.apache.http.HttpMessage>
Known Indirect Subclasses

Class Overview

Abstract HTTP message parser for non-blocking connections.

Summary

Public Methods
abstract int fillBuffer(ReadableByteChannel channel)
Fills the internal buffer of the parser with input data from the given ReadableByteChannel.
abstract T parse()
Attempts to parse a complete message head from the content of the internal buffer.
abstract void reset()
Resets the parser.

Public Methods

public abstract int fillBuffer (ReadableByteChannel channel)

Fills the internal buffer of the parser with input data from the given ReadableByteChannel.

Parameters
channel the input channel
Returns
  • number of bytes read.
Throws
IOException in case of an I/O error.

public abstract T parse ()

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.

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.

public abstract void reset ()

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