public class StrictContentLengthStrategy extends java.lang.Object implements ContentLengthStrategy
ProtocolException
if it encounters an unsupported
transfer encoding or a malformed Content-Length
header
value.
This class recognizes "chunked" and "identitiy" transfer-coding only.
CHUNKED, IDENTITY
Constructor and Description |
---|
StrictContentLengthStrategy() |
Modifier and Type | Method and Description |
---|---|
long |
determineLength(HttpMessage message)
Returns length of the given message in bytes.
|
public long determineLength(HttpMessage message) throws HttpException
ContentLengthStrategy
ContentLengthStrategy.IDENTITY
if the end of the
message will be delimited by the end of connection, or ContentLengthStrategy.CHUNKED
if the message is chunk codeddetermineLength
in interface ContentLengthStrategy
ContentLengthStrategy.IDENTITY
, or ContentLengthStrategy.CHUNKED
HttpException
- in case of HTTP protocol violation