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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intprivate InputStreamprivate final org.apache.hc.core5.io.IOFunction<InputStream, InputStream> -
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.private InputStreamvoidwriteTo(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
-
Field Details
-
BUF_SIZE
private static final int BUF_SIZE- See Also:
-
decoder
-
cached
-
-
Constructor Details
-
DecompressingEntity
public DecompressingEntity(org.apache.hc.core5.http.HttpEntity src, org.apache.hc.core5.io.IOFunction<InputStream, InputStream> decoder)
-
-
Method Details
-
getDecompressingStream
- Throws:
IOException
-
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
-