Class DecompressingEntity

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, org.apache.hc.core5.http.EntityDetails, org.apache.hc.core5.http.HttpEntity
    Direct Known Subclasses:
    BrotliDecompressingEntity, DeflateDecompressingEntity, GzipDecompressingEntity

    public class DecompressingEntity
    extends org.apache.hc.core5.http.io.entity.HttpEntityWrapper
    Common base class for decompressing HttpEntity implementations.
    Since:
    4.4
    • Field Detail

      • content

        private java.io.InputStream content
        getContent() method must return the same InputStream instance when DecompressingEntity is wrapping a streaming entity.
    • Constructor Detail

      • DecompressingEntity

        public DecompressingEntity​(org.apache.hc.core5.http.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

      • getDecompressingStream

        private java.io.InputStream getDecompressingStream()
                                                    throws java.io.IOException
        Throws:
        java.io.IOException
      • getContent

        public java.io.InputStream getContent()
                                       throws java.io.IOException
        Specified by:
        getContent in interface org.apache.hc.core5.http.HttpEntity
        Overrides:
        getContent in class org.apache.hc.core5.http.io.entity.HttpEntityWrapper
        Throws:
        java.io.IOException
      • writeTo

        public void writeTo​(java.io.OutputStream outStream)
                     throws java.io.IOException
        Specified by:
        writeTo in interface org.apache.hc.core5.http.HttpEntity
        Overrides:
        writeTo in class org.apache.hc.core5.http.io.entity.HttpEntityWrapper
        Throws:
        java.io.IOException
      • getContentEncoding

        public java.lang.String getContentEncoding()
        Specified by:
        getContentEncoding in interface org.apache.hc.core5.http.EntityDetails
        Overrides:
        getContentEncoding in class org.apache.hc.core5.http.io.entity.HttpEntityWrapper
      • getContentLength

        public long getContentLength()
        Specified by:
        getContentLength in interface org.apache.hc.core5.http.EntityDetails
        Overrides:
        getContentLength in class org.apache.hc.core5.http.io.entity.HttpEntityWrapper