public class HttpResponseDecoder extends Object
Modifier and Type | Class and Description |
---|---|
static class |
HttpResponseDecoder.Step |
Modifier and Type | Field and Description |
---|---|
static int |
MAX_LENGTH_OF_HEADER
头部,最多有多少字节
|
static int |
MAX_LENGTH_OF_HEADERLINE
头部,每行最大的字节数
|
static int |
MAX_LENGTH_OF_RESPONSELINE
请求行的最大长度
|
Constructor and Description |
---|
HttpResponseDecoder() |
Modifier and Type | Method and Description |
---|---|
static HttpResponse |
decode(ByteBuffer buffer,
int limit,
int position,
int readableLength,
ChannelContext channelContext) |
static void |
decodeParams(Map<String,Object[]> params,
String queryString,
String charset,
ChannelContext channelContext) |
static boolean |
parseHeaderLine(ByteBuffer buffer,
Map<String,String> headers,
int headerLength)
解析请求头的每一行
|
static ResponseLine |
parseResponseLine(ByteBuffer buffer,
ChannelContext channelContext)
parse response line(the first line)
|
public static final int MAX_LENGTH_OF_HEADER
public static final int MAX_LENGTH_OF_HEADERLINE
public static final int MAX_LENGTH_OF_RESPONSELINE
public static HttpResponse decode(ByteBuffer buffer, int limit, int position, int readableLength, ChannelContext channelContext) throws TioDecodeException
buffer
- limit
- position
- readableLength
- channelContext
- TioDecodeException
public static void decodeParams(Map<String,Object[]> params, String queryString, String charset, ChannelContext channelContext)
params
- queryString
- charset
- channelContext
- public static boolean parseHeaderLine(ByteBuffer buffer, Map<String,String> headers, int headerLength) throws TioDecodeException
TioDecodeException
public static ResponseLine parseResponseLine(ByteBuffer buffer, ChannelContext channelContext) throws TioDecodeException
TioDecodeException
Copyright © 2021. All rights reserved.