org.apache.http.impl.nio.codecs

## Class DefaultHttpRequestParser

- java.lang.Object
- - org.apache.http.impl.nio.codecs.AbstractMessageParser<HttpRequest>
  - - org.apache.http.impl.nio.codecs.DefaultHttpRequestParser

All Implemented Interfaces:
  NHttpMessageParser<HttpRequest>

    @NotThreadSafe
    public class DefaultHttpRequestParser
    extends AbstractMessageParser<HttpRequest>

Default `NHttpMessageParser` implementation for `HttpRequest`s.

Since:
  4.1

### Field Summary

### Fields inherited from class org.apache.http.impl.nio.codecs.AbstractMessageParser

`lineParser`

### Constructor Summary

Constructors
Constructor and Description
`DefaultHttpRequestParser(SessionInputBuffer buffer)`
`DefaultHttpRequestParser(SessionInputBuffer buffer, LineParser parser, HttpRequestFactory requestFactory, HttpParams params)` Deprecated. (4.3) use `DefaultHttpRequestParser( SessionInputBuffer, LineParser, HttpRequestFactory, MessageConstraints)`
`DefaultHttpRequestParser(SessionInputBuffer buffer, LineParser parser, HttpRequestFactory requestFactory, MessageConstraints constraints)` Creates an instance of DefaultHttpRequestParser.
`DefaultHttpRequestParser(SessionInputBuffer buffer, MessageConstraints constraints)`

### Method Summary

Methods
`protected HttpRequest` `createMessage(CharArrayBuffer buffer)` Creates `HttpMessage` instance based on the content of the input buffer containing the first line of the incoming HTTP message.

### Methods inherited from class org.apache.http.impl.nio.codecs.AbstractMessageParser

`fillBuffer, parse, reset`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### DefaultHttpRequestParser

    @Deprecated
    public DefaultHttpRequestParser(SessionInputBuffer buffer,
                                       LineParser parser,
                                       HttpRequestFactory requestFactory,
                                       HttpParams params)

Deprecated. (4.3) use `DefaultHttpRequestParser( SessionInputBuffer, LineParser, HttpRequestFactory, MessageConstraints)`
Creates an instance of this class.

Parameters:
  `buffer` - the session input buffer.
  `parser` - the line parser.
  `params` - HTTP parameters.

#### DefaultHttpRequestParser

    public DefaultHttpRequestParser(SessionInputBuffer buffer,
                            LineParser parser,
                            HttpRequestFactory requestFactory,
                            MessageConstraints constraints)

Creates an instance of DefaultHttpRequestParser.

Parameters:
  `buffer` - the session input buffer.
  `parser` - the line parser. If `null` `BasicLineParser.INSTANCE` will be used.
  `requestFactory` - the request factory. If `null` `DefaultHttpRequestFactory.INSTANCE` will be used.
  `constraints` - Message constraints. If `null` `MessageConstraints.DEFAULT` will be used.
Since:
  4.3

#### DefaultHttpRequestParser

    public DefaultHttpRequestParser(SessionInputBuffer buffer,
                            MessageConstraints constraints)

Since:
  4.3

#### DefaultHttpRequestParser

    public DefaultHttpRequestParser(SessionInputBuffer buffer)

Since:
  4.3

### Method Detail

#### createMessage

    protected HttpRequest createMessage(CharArrayBuffer buffer)
                                 throws HttpException,
                                        ParseException

Description copied from class: `AbstractMessageParser`
Creates `HttpMessage` instance based on the content of the input buffer containing the first line of the incoming HTTP message.

Specified by:
  `createMessage` in class `AbstractMessageParser<HttpRequest>`
Parameters:
  `buffer` - the line buffer.
Returns:
  HTTP message.
Throws:
  `HttpException` - in case of HTTP protocol violation
  `ParseException` - in case of a parse error.