public interface HttpRequestParser
HttpRequest
.Modifier and Type | Method and Description |
---|---|
HttpEntity |
getEntity()
Obtains the
HttpEntity of the HttpRequest . |
List<HttpHeader> |
getHeaders()
Obtains the
HttpHeader instances in the order supplied. |
String |
getHttpVersion()
Obtains the HTTP version.
|
String |
getMethod()
Obtains the method.
|
String |
getRequestURI()
Obtains the request URI.
|
int |
nextByteToParseIndex()
Obtains the index of the next byte to parse from the previous
parse(byte[], int) . |
boolean |
parse(byte[] data,
int startIndex)
Parses the
HttpRequest from the data. |
void |
reset()
Resets for parsing another
HttpRequest . |
boolean parse(byte[] data, int startIndex) throws IOException, HttpRequestParseException
HttpRequest
from the data.data
- Data to be parsed for the HttpRequest
.startIndex
- Index within the data to start parsing.true
if the HttpRequest
has been fully
parsed. false
indicates this method should be called
again when further data is available to obtain the full
HttpRequest
.IOException
- If fails to read bytes.HttpRequestParseException
- If failure to parse HttpRequest
.nextByteToParseIndex()
int nextByteToParseIndex()
Obtains the index of the next byte to parse from the previous
parse(byte[], int)
.
Should all bytes be consumed this will return -1
. Note that
if parse(byte[], int)
returns false
, this will
always return -1
as all bytes are to be consumed.
-1
if all bytes
consumed.void reset()
HttpRequest
.String getMethod()
String getRequestURI()
String getHttpVersion()
List<HttpHeader> getHeaders()
HttpHeader
instances in the order supplied.HttpHeader
instances in the order supplied.HttpEntity getEntity()
HttpEntity
of the HttpRequest
.HttpEntity
of the HttpRequest
.Copyright © 2005–2016. All rights reserved.