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
HTTP entity wrapper whose content is provided by a
ContentInputBuffer.- Since:
- 4.0
-
Constructor Summary
ConstructorsConstructorDescriptionContentBufferEntity(HttpEntity entity, ContentInputBuffer buffer) Creates new instance of ContentBufferEntity. -
Method Summary
Modifier and TypeMethodDescriptionObtains the Content-Encoding header.longTells the length of the content, if known.Obtains the Content-Type header.booleanObtains the 'chunked' flag.Methods inherited from class org.apache.http.entity.BasicHttpEntity
getContent, isRepeatable, isStreaming, setContent, setContentLength, writeToMethods inherited from class org.apache.http.entity.AbstractHttpEntity
consumeContent, setChunked, setContentEncoding, setContentEncoding, setContentType, setContentType, toString
-
Constructor Details
-
ContentBufferEntity
Creates new instance of ContentBufferEntity.- Parameters:
entity- the original entity.buffer- the content buffer.
-
-
Method Details
-
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
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
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
-