org.apache.hc.client5.http.entity.compress

## Class DecompressingEntity

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

All Implemented Interfaces:
  Closeable, AutoCloseable, EntityDetails, HttpEntity

    public class DecompressingEntity
    extends HttpEntityWrapper

### Constructor Summary

Constructors
Constructor and Description
`DecompressingEntity(HttpEntity src, IOFunction<InputStream,InputStream> decoder)`

### Method Summary

All Methods Instance Methods Concrete Methods
`InputStream` `getContent()` Returns the cached decoded stream, creating it once if necessary.
`String` `getContentEncoding()` Content is no longer encoded
`long` `getContentLength()` Length is unknown after decompression.
`void` `writeTo(OutputStream out)` Streams the decoded bytes directly to `out`.

### 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 src,
                               IOFunction<InputStream,InputStream> decoder)

### Method Detail

#### getContent

    public InputStream getContent()
                           throws IOException

Returns the cached decoded stream, creating it once if necessary.

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

#### getContentLength

    public long getContentLength()

Length is unknown after decompression.

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

#### getContentEncoding

    public String getContentEncoding()

Content is no longer encoded

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

#### writeTo

    public void writeTo(OutputStream out)
                 throws IOException

Streams the decoded bytes directly to `out`.

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