Package org.apache.http.client.entity
Class DecompressingEntity
- java.lang.Object
-
- org.apache.http.entity.HttpEntityWrapper
-
- org.apache.http.client.entity.DecompressingEntity
-
- All Implemented Interfaces:
org.apache.http.HttpEntity
- Direct Known Subclasses:
DeflateDecompressingEntity,GzipDecompressingEntity
public class DecompressingEntity extends org.apache.http.entity.HttpEntityWrapperCommon base class for decompressingHttpEntityimplementations.- Since:
- 4.4
-
-
Field Summary
Fields Modifier and Type Field Description private static intBUFFER_SIZEDefault buffer size.private java.io.InputStreamcontentgetContent()method must return the sameInputStreaminstance when DecompressingEntity is wrapping a streaming entity.private InputStreamFactoryinputStreamFactory
-
Constructor Summary
Constructors Constructor Description DecompressingEntity(org.apache.http.HttpEntity wrapped, InputStreamFactory inputStreamFactory)Creates a newDecompressingEntity.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.io.InputStreamgetContent()org.apache.http.HeadergetContentEncoding()longgetContentLength()private java.io.InputStreamgetDecompressingStream()voidwriteTo(java.io.OutputStream outStream)
-
-
-
Field Detail
-
BUFFER_SIZE
private static final int BUFFER_SIZE
Default buffer size.- See Also:
- Constant Field Values
-
inputStreamFactory
private final InputStreamFactory inputStreamFactory
-
content
private java.io.InputStream content
getContent()method must return the sameInputStreaminstance when DecompressingEntity is wrapping a streaming entity.
-
-
Constructor Detail
-
DecompressingEntity
public DecompressingEntity(org.apache.http.HttpEntity wrapped, InputStreamFactory inputStreamFactory)Creates a newDecompressingEntity.- Parameters:
wrapped- the non-nullHttpEntityto be wrappedinputStreamFactory- 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:
getContentin interfaceorg.apache.http.HttpEntity- Overrides:
getContentin classorg.apache.http.entity.HttpEntityWrapper- Throws:
java.io.IOException
-
writeTo
public void writeTo(java.io.OutputStream outStream) throws java.io.IOException- Specified by:
writeToin interfaceorg.apache.http.HttpEntity- Overrides:
writeToin classorg.apache.http.entity.HttpEntityWrapper- Throws:
java.io.IOException
-
getContentEncoding
public org.apache.http.Header getContentEncoding()
- Specified by:
getContentEncodingin interfaceorg.apache.http.HttpEntity- Overrides:
getContentEncodingin classorg.apache.http.entity.HttpEntityWrapper
-
getContentLength
public long getContentLength()
- Specified by:
getContentLengthin interfaceorg.apache.http.HttpEntity- Overrides:
getContentLengthin classorg.apache.http.entity.HttpEntityWrapper
-
-