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 HeadergetContentEncoding()Obtains the Content-Encoding header.longgetContentLength()Tells the length of the content, if known.HeadergetContentType()Obtains the Content-Type header.booleanisChunked()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:AbstractHttpEntityObtains the 'chunked' flag. The default implementation returns the value of thechunkedattribute.- Specified by:
isChunkedin interfaceHttpEntity- Overrides:
isChunkedin classAbstractHttpEntity- Returns:
- the 'chunked' flag
-
getContentLength
public long getContentLength()
Description copied from interface:HttpEntityTells the length of the content, if known.- Specified by:
getContentLengthin interfaceHttpEntity- Overrides:
getContentLengthin 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:AbstractHttpEntityObtains the Content-Type header. The default implementation returns the value of thecontentTypeattribute.- Specified by:
getContentTypein interfaceHttpEntity- Overrides:
getContentTypein classAbstractHttpEntity- Returns:
- the Content-Type header, or
null
-
getContentEncoding
public Header getContentEncoding()
Description copied from class:AbstractHttpEntityObtains the Content-Encoding header. The default implementation returns the value of thecontentEncodingattribute.- Specified by:
getContentEncodingin interfaceHttpEntity- Overrides:
getContentEncodingin classAbstractHttpEntity- Returns:
- the Content-Encoding header, or
null
-
-