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,org.apache.hc.core5.http.EntityDetails,org.apache.hc.core5.http.HttpEntity
public class DecompressingEntity
extends org.apache.hc.core5.http.io.entity.HttpEntityWrapper
-
Constructor Summary
ConstructorsConstructorDescriptionDecompressingEntity(org.apache.hc.core5.http.HttpEntity src, org.apache.hc.core5.io.IOFunction<InputStream, InputStream> decoder) -
Method Summary
Modifier and TypeMethodDescriptionReturns the cached decoded stream, creating it once if necessary.Content is no longer encodedlongLength is unknown after decompression.voidwriteTo(OutputStream out) Streams the decoded bytes directly toout.Methods inherited from class org.apache.hc.core5.http.io.entity.HttpEntityWrapper
close, getContentType, getTrailerNames, getTrailers, isChunked, isRepeatable, isStreaming, toString
-
Constructor Details
-
DecompressingEntity
public DecompressingEntity(org.apache.hc.core5.http.HttpEntity src, org.apache.hc.core5.io.IOFunction<InputStream, InputStream> decoder)
-
-
Method Details
-
getContent
Returns the cached decoded stream, creating it once if necessary.- Specified by:
getContentin interfaceorg.apache.hc.core5.http.HttpEntity- Overrides:
getContentin classorg.apache.hc.core5.http.io.entity.HttpEntityWrapper- Throws:
IOException
-
getContentLength
public long getContentLength()Length is unknown after decompression.- Specified by:
getContentLengthin interfaceorg.apache.hc.core5.http.EntityDetails- Overrides:
getContentLengthin classorg.apache.hc.core5.http.io.entity.HttpEntityWrapper
-
getContentEncoding
Content is no longer encoded- Specified by:
getContentEncodingin interfaceorg.apache.hc.core5.http.EntityDetails- Overrides:
getContentEncodingin classorg.apache.hc.core5.http.io.entity.HttpEntityWrapper
-
writeTo
Streams the decoded bytes directly toout.- Specified by:
writeToin interfaceorg.apache.hc.core5.http.HttpEntity- Overrides:
writeToin classorg.apache.hc.core5.http.io.entity.HttpEntityWrapper- Throws:
IOException
-