/**
* 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.
*
* @param inbuffer Session input buffer
* @param maxHeaderCount 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.
* @param maxLineLen maximum number of characters for a header line,
* including the continuation lines. Setting this parameter to a negative
* value or zero will disable the check.
* @return array of HTTP headers
* @param parser line parser to use. Can be <code>null</code>, in which case
* the default implementation of this interface will be used.
*
* @throws IOException in case of an I/O error
* @throws HttpException in case of HTTP protocol violation
*/
public static Header[] parseHeaders(
final SessionInputBuffer inbuffer,
final int maxHeaderCount,
final int maxLineLen,
final LineParser parser) throws HttpException, IOException {
final List<CharArrayBuffer> headerLines = new ArrayList<CharArrayBuffer>();
return parseHeaders(inbuffer, maxHeaderCount, maxLineLen,
parser != null ? parser : BasicLineParserHC4.INSTANCE,
headerLines);
}
AbstractMessageParserHC4.java 文件源码
java
阅读 32
收藏 0
点赞 0
评论 0
项目:ZTLib
作者:
评论列表
文章目录