Top Description Fields Methods
org.apache.http.entity

public Interface ContentLengthStrategy

Known Direct Implementers
org.apache.http.impl.entity.DisallowIdentityContentLengthStrategy, org.apache.http.impl.entity.LaxContentLengthStrategy, org.apache.http.impl.entity.StrictContentLengthStrategy
Imports
org.apache.http.HttpException, .HttpMessage

Represents a strategy to determine length of the enclosed content entity based on properties of the HTTP message.
Since
4.0

Field Summary

Modifier and TypeField and Description
public static final int
public static final int

Method Summary

Modifier and TypeMethod and Description
public long

Returns:

content length, IDENTITY, or CHUNKED
determineLength
(HttpMessage
HTTP message
message
)

Returns length of the given message in bytes.

Field Detail

CHUNKEDback to summary
public static final int CHUNKED
IDENTITYback to summary
public static final int IDENTITY

Method Detail

determineLengthback to summary
public long determineLength(HttpMessage message) throws HttpException

Returns length of the given message in bytes. The returned value must be a non-negative number, IDENTITY if the end of the message will be delimited by the end of connection, or CHUNKED if the message is chunk coded

Parameters
message:HttpMessage

HTTP message

Returns:long

content length, IDENTITY, or CHUNKED

Exceptions
HttpException:
in case of HTTP protocol violation