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

    @NotThreadSafe
    public class ContentBufferEntity
    extends BasicHttpEntity

HTTP entity wrapper whose content is provided by a `ContentInputBuffer`.

Since:
  4.0

### Field Summary

### Fields inherited from class org.apache.http.entity.AbstractHttpEntity

`chunked, contentEncoding, contentType, OUTPUT_BUFFER_SIZE`

### Constructor Summary

Constructors
Constructor and Description
`ContentBufferEntity(HttpEntity entity, ContentInputBuffer buffer)` Creates new instance of ContentBufferEntity.

### Method Summary

Methods
`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`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### 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 the `chunked` attribute.

Specified by:
  `isChunked` in interface `HttpEntity`
Overrides:
  `isChunked` in class `AbstractHttpEntity`
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 interface `HttpEntity`
Overrides:
  `getContentLength` in class `BasicHttpEntity`
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 the `contentType` attribute.

Specified by:
  `getContentType` in interface `HttpEntity`
Overrides:
  `getContentType` in class `AbstractHttpEntity`
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 the `contentEncoding` attribute.

Specified by:
  `getContentEncoding` in interface `HttpEntity`
Overrides:
  `getContentEncoding` in class `AbstractHttpEntity`
Returns:
  the Content-Encoding header, or `null`