org.apache.http.impl.entity
Class StrictContentLengthStrategyHC4

java.lang.Object
  extended by 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

Field Summary
static StrictContentLengthStrategyHC4 INSTANCE
           
 
Fields inherited from interface org.apache.http.entity.ContentLengthStrategy
CHUNKED, IDENTITY
 
Constructor Summary
StrictContentLengthStrategyHC4()
          Creates StrictContentLengthStrategy instance.
StrictContentLengthStrategyHC4(int implicitLen)
          Creates StrictContentLengthStrategy instance with the given length used per default when content length is not explicitly specified in the message.
 
Method Summary
 long determineLength(org.apache.http.HttpMessage message)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final StrictContentLengthStrategyHC4 INSTANCE
Constructor Detail

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.

Method Detail

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