@Contract(threading=IMMUTABLE) public class DefaultContentLengthStrategy extends Object implements ContentLengthStrategy
ProtocolException if it encounters an unsupported
transfer encoding, multiple Content-Length header
values or a malformed Content-Length header value.
This class recognizes "chunked" transfer-coding only.
| 限定符和类型 | 字段和说明 |
|---|---|
static DefaultContentLengthStrategy |
INSTANCE |
CHUNKED, UNDEFINED| 构造器和说明 |
|---|
DefaultContentLengthStrategy()
Creates
DefaultContentLengthStrategy instance. |
public static final DefaultContentLengthStrategy INSTANCE
public DefaultContentLengthStrategy()
DefaultContentLengthStrategy instance. ContentLengthStrategy.UNDEFINED
is used per default when content length is not explicitly specified in the message.public long determineLength(HttpMessage message) throws HttpException
ContentLengthStrategyContentLengthStrategy.CHUNKED if the message is
chunk coded, or ContentLengthStrategy.UNDEFINED if the message is not explicitly
delineated.determineLength 在接口中 ContentLengthStrategymessage - HTTP messageContentLengthStrategy.UNDEFINED, or ContentLengthStrategy.CHUNKEDHttpException - in case of HTTP protocol violationCopyright © 2023. All rights reserved.