@Immutable public class LaxContentLengthStrategy extends java.lang.Object implements ContentLengthStrategy
Content-Length
header values.
This class recognizes "chunked" and "identitiy" transfer-coding only.| 限定符和类型 | 字段和说明 |
|---|---|
static LaxContentLengthStrategy |
INSTANCE |
CHUNKED, IDENTITY| 构造器和说明 |
|---|
LaxContentLengthStrategy()
Creates LaxContentLengthStrategy instance.
|
LaxContentLengthStrategy(int implicitLen)
Creates LaxContentLengthStrategy instance with the given length used per default
when content length is not explicitly specified in the message.
|
| 限定符和类型 | 方法和说明 |
|---|---|
long |
determineLength(HttpMessage message)
Returns length of the given message in bytes.
|
public static final LaxContentLengthStrategy INSTANCE
public LaxContentLengthStrategy(int implicitLen)
implicitLen - implicit content length.public LaxContentLengthStrategy()
ContentLengthStrategy.IDENTITY
is used per default when content length is not explicitly specified in the message.public long determineLength(HttpMessage message) throws HttpException
ContentLengthStrategyContentLengthStrategy.IDENTITY if the end of the
message will be delimited by the end of connection, or ContentLengthStrategy.CHUNKED
if the message is chunk codeddetermineLength 在接口中 ContentLengthStrategymessage - HTTP messageContentLengthStrategy.IDENTITY, or ContentLengthStrategy.CHUNKEDHttpException - in case of HTTP protocol violation