org.apache.http.impl.entity
Class StrictContentLengthStrategyHC4
java.lang.Object
org.apache.http.impl.entity.StrictContentLengthStrategyHC4
- All Implemented Interfaces:
- org.apache.http.entity.ContentLengthStrategy
@Immutable
public class StrictContentLengthStrategyHC4
- extends java.lang.Object
- implements org.apache.http.entity.ContentLengthStrategy
The strict implementation of the content length strategy. This class
will throw ProtocolException if it encounters an unsupported
transfer encoding or a malformed Content-Length header
value.
This class recognizes "chunked" and "identitiy" transfer-coding only.
- Since:
- 4.0
| Fields inherited from interface org.apache.http.entity.ContentLengthStrategy |
CHUNKED, IDENTITY |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
INSTANCE
public static final StrictContentLengthStrategyHC4 INSTANCE
StrictContentLengthStrategyHC4
public StrictContentLengthStrategyHC4(int implicitLen)
- Creates StrictContentLengthStrategy instance with the given length used per default
when content length is not explicitly specified in the message.
- Parameters:
implicitLen - implicit content length.- Since:
- 4.2
StrictContentLengthStrategyHC4
public StrictContentLengthStrategyHC4()
- Creates StrictContentLengthStrategy instance.
ContentLengthStrategy.IDENTITY
is used per default when content length is not explicitly specified in the message.
determineLength
public long determineLength(org.apache.http.HttpMessage message)
throws org.apache.http.HttpException
- Specified by:
determineLength in interface org.apache.http.entity.ContentLengthStrategy
- Throws:
org.apache.http.HttpException