Package org.apache.hc.core5.http
Interface ContentLengthStrategy
- All Known Implementing Classes:
DefaultContentLengthStrategy
Represents a strategy to determine length of the enclosed content entity
based on properties of the HTTP message.
- Since:
- 4.0
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionlongdetermineLength(HttpMessage message) Returns length of the given message in bytes.
-
Field Details
-
CHUNKED
static final long CHUNKEDMessage body chunk coded- See Also:
-
UNDEFINED
static final long UNDEFINEDMessage body not explicitly delineated. Legal for HTTP response messages and illegal for HTTP request messages.- See Also:
-
-
Method Details
-
determineLength
Returns length of the given message in bytes. The returned value must be a non-negative number,CHUNKEDif the message is chunk coded, orUNDEFINEDif the message is not explicitly delineated.- Parameters:
message- HTTP message- Returns:
- content length,
UNDEFINED, orCHUNKED - Throws:
HttpException- in case of HTTP protocol violation
-