Package org.apache.http.nio.entity
Class ContentBufferEntity
- java.lang.Object
-
- org.apache.http.entity.AbstractHttpEntity
-
- org.apache.http.entity.BasicHttpEntity
-
- org.apache.http.nio.entity.ContentBufferEntity
-
- All Implemented Interfaces:
HttpEntity
public class ContentBufferEntity extends BasicHttpEntity
HTTP entity wrapper whose content is provided by aContentInputBuffer
.- Since:
- 4.0
-
-
Constructor Summary
Constructors Constructor Description ContentBufferEntity(HttpEntity entity, ContentInputBuffer buffer)
Creates new instance of ContentBufferEntity.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Header
getContentEncoding()
Obtains the Content-Encoding header.long
getContentLength()
Tells the length of the content, if known.Header
getContentType()
Obtains the Content-Type header.boolean
isChunked()
Obtains the 'chunked' flag.-
Methods inherited from class org.apache.http.entity.BasicHttpEntity
getContent, isRepeatable, isStreaming, setContent, setContentLength, writeTo
-
Methods inherited from class org.apache.http.entity.AbstractHttpEntity
consumeContent, setChunked, setContentEncoding, setContentEncoding, setContentType, setContentType, toString
-
-
-
-
Constructor Detail
-
ContentBufferEntity
public ContentBufferEntity(HttpEntity entity, ContentInputBuffer buffer)
Creates new instance of ContentBufferEntity.- Parameters:
entity
- the original entity.buffer
- the content buffer.
-
-
Method Detail
-
isChunked
public boolean isChunked()
Description copied from class:AbstractHttpEntity
Obtains the 'chunked' flag. The default implementation returns the value of thechunked
attribute.- Specified by:
isChunked
in interfaceHttpEntity
- Overrides:
isChunked
in classAbstractHttpEntity
- Returns:
- the 'chunked' flag
-
getContentLength
public long getContentLength()
Description copied from interface:HttpEntity
Tells the length of the content, if known.- Specified by:
getContentLength
in interfaceHttpEntity
- Overrides:
getContentLength
in classBasicHttpEntity
- Returns:
- the number of bytes of the content, or
a negative number if unknown. If the content length is known
but exceeds
Long.MAX_VALUE
, a negative number is returned.
-
getContentType
public Header getContentType()
Description copied from class:AbstractHttpEntity
Obtains the Content-Type header. The default implementation returns the value of thecontentType
attribute.- Specified by:
getContentType
in interfaceHttpEntity
- Overrides:
getContentType
in classAbstractHttpEntity
- Returns:
- the Content-Type header, or
null
-
getContentEncoding
public Header getContentEncoding()
Description copied from class:AbstractHttpEntity
Obtains the Content-Encoding header. The default implementation returns the value of thecontentEncoding
attribute.- Specified by:
getContentEncoding
in interfaceHttpEntity
- Overrides:
getContentEncoding
in classAbstractHttpEntity
- Returns:
- the Content-Encoding header, or
null
-
-