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
-
Field Summary
FieldsFields inherited from class org.apache.http.entity.AbstractHttpEntity
chunked, contentEncoding, contentType, OUTPUT_BUFFER_SIZE
-
Constructor Summary
ConstructorsConstructorDescriptionContentBufferEntity
(HttpEntity entity, ContentInputBuffer buffer) Creates new instance of ContentBufferEntity. -
Method Summary
Modifier and TypeMethodDescriptionObtains the Content-Encoding header.long
Tells the length of the content, if known.Obtains the Content-Type header.boolean
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
-
Field Details
-
wrappedEntity
-
-
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: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
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
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
-