org.apache.hc.client5.http.entity

## Class DecompressingEntity

- java.lang.Object
- - org.apache.hc.core5.http.io.entity.HttpEntityWrapper
  - - org.apache.hc.client5.http.entity.DecompressingEntity

All Implemented Interfaces:
  Closeable, AutoCloseable, EntityDetails, HttpEntity

Direct Known Subclasses:
  BrotliDecompressingEntity, DeflateDecompressingEntity, GzipDecompressingEntity

    public class DecompressingEntity
    extends HttpEntityWrapper

Common base class for decompressing `HttpEntity` implementations.

Since:
  4.4

### Constructor Summary

Constructors
Constructor and Description
`DecompressingEntity(HttpEntity wrapped, InputStreamFactory inputStreamFactory)` Constructs a new `DecompressingEntity`.

### Method Summary

All Methods Instance Methods Concrete Methods
`InputStream` `getContent()`
`String` `getContentEncoding()`
`long` `getContentLength()`
`void` `writeTo(OutputStream outStream)`

### Methods inherited from class org.apache.hc.core5.http.io.entity.HttpEntityWrapper

`close, getContentType, getTrailerNames, getTrailers, isChunked, isRepeatable, isStreaming, toString`

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

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

### Constructor Detail

#### DecompressingEntity

    public DecompressingEntity(HttpEntity wrapped,
                               InputStreamFactory inputStreamFactory)

Constructs a new `DecompressingEntity`.

Parameters:
  `wrapped` - the non-null `HttpEntity` to be wrapped
  `inputStreamFactory` - factory to create decompressing stream.

### Method Detail

#### getContent

    public InputStream getContent()
                           throws IOException

Specified by:
  `getContent` in interface `HttpEntity`
Overrides:
  `getContent` in class `HttpEntityWrapper`
Throws:
  `IOException`

#### writeTo

    public void writeTo(OutputStream outStream)
                 throws IOException

Specified by:
  `writeTo` in interface `HttpEntity`
Overrides:
  `writeTo` in class `HttpEntityWrapper`
Throws:
  `IOException`

#### getContentEncoding

    public String getContentEncoding()

Specified by:
  `getContentEncoding` in interface `EntityDetails`
Overrides:
  `getContentEncoding` in class `HttpEntityWrapper`

#### getContentLength

    public long getContentLength()

Specified by:
  `getContentLength` in interface `EntityDetails`
Overrides:
  `getContentLength` in class `HttpEntityWrapper`