org.apache.http.impl.entity
Class LaxContentLengthStrategyHC4

java.lang.Object
  extended by org.apache.http.impl.entity.LaxContentLengthStrategyHC4
All Implemented Interfaces:
org.apache.http.entity.ContentLengthStrategy

@Immutable
public class LaxContentLengthStrategyHC4
extends java.lang.Object
implements org.apache.http.entity.ContentLengthStrategy

The lax implementation of the content length strategy. This class will ignore unrecognized transfer encodings and malformed Content-Length header values.

This class recognizes "chunked" and "identitiy" transfer-coding only.

Since:
4.0

Field Summary
static LaxContentLengthStrategyHC4 INSTANCE
           
 
Fields inherited from interface org.apache.http.entity.ContentLengthStrategy
CHUNKED, IDENTITY
 
Constructor Summary
LaxContentLengthStrategyHC4()
          Creates LaxContentLengthStrategy instance.
LaxContentLengthStrategyHC4(int implicitLen)
          Creates LaxContentLengthStrategy 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 LaxContentLengthStrategyHC4 INSTANCE
Constructor Detail

LaxContentLengthStrategyHC4

public LaxContentLengthStrategyHC4(int implicitLen)
Creates LaxContentLengthStrategy 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

LaxContentLengthStrategyHC4

public LaxContentLengthStrategyHC4()
Creates LaxContentLengthStrategy 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