Package org.apache.http.impl.io
Class AbstractMessageParser
java.lang.Object
org.apache.http.impl.io.AbstractMessageParser
- All Implemented Interfaces:
HttpMessageParser
- Direct Known Subclasses:
DefaultResponseParser,HttpRequestParser,HttpResponseParser
public abstract class AbstractMessageParser extends Object implements HttpMessageParser
Message parser base class.
- Author:
- Michael Becke, Oleg Kalnichevski
-
Field Summary
Fields Modifier and Type Field Description protected LineParserlineParser -
Constructor Summary
Constructors Constructor Description AbstractMessageParser(SessionInputBuffer buffer, LineParser parser, HttpParams params) -
Method Summary
Modifier and Type Method Description HttpMessageparse()protected abstract HttpMessageparseHead(SessionInputBuffer sessionBuffer)static Header[]parseHeaders(SessionInputBuffer inbuffer, int maxHeaderCount, int maxLineLen, LineParser parser)Parses HTTP headers from the data receiver stream according to the generic format as given in Section 3.1 of RFC 822, RFC-2616 Section 4 and 19.3.
-
Field Details
-
lineParser
-
-
Constructor Details
-
AbstractMessageParser
-
-
Method Details
-
parseHeaders
public static Header[] parseHeaders(SessionInputBuffer inbuffer, int maxHeaderCount, int maxLineLen, LineParser parser) throws HttpException, IOExceptionParses HTTP headers from the data receiver stream according to the generic format as given in Section 3.1 of RFC 822, RFC-2616 Section 4 and 19.3.- Parameters:
inbuffer- Session input buffermaxHeaderCount- maximum number of headers allowed. If the number of headers received from the data stream exceeds maxCount value, an IOException will be thrown. Setting this parameter to a negative value or zero will disable the check.maxLineLen- maximum number of characters for a header line, including the continuation lines- Returns:
- array of HTTP headers
- Throws:
HttpExceptionIOException
-
parseHead
protected abstract HttpMessage parseHead(SessionInputBuffer sessionBuffer) throws IOException, HttpException, ParseException- Throws:
IOExceptionHttpExceptionParseException
-
parse
- Specified by:
parsein interfaceHttpMessageParser- Throws:
IOExceptionHttpException
-