org.apache.http.client.entity
Class DeflateDecompressingEntity

java.lang.Object
  extended by org.apache.http.entity.HttpEntityWrapper
      extended by org.apache.http.client.entity.DeflateDecompressingEntity
All Implemented Interfaces:
HttpEntity

public class DeflateDecompressingEntity
extends HttpEntityWrapper

HttpEntityWrapper responsible for handling deflate Content Coded responses. In RFC2616 terms, deflate means a zlib stream as defined in RFC1950. Some server implementations have misinterpreted RFC2616 to mean that a deflate stream as defined in RFC1951 should be used (or maybe they did that since that's how IE behaves?). It's confusing that deflate in HTTP 1.1 means zlib streams rather than deflate streams. We handle both types in here, since that's what is seen on the internet. Moral - prefer gzip!

Since:
4.1
See Also:
GzipDecompressingEntity

Field Summary
 
Fields inherited from class org.apache.http.entity.HttpEntityWrapper
wrappedEntity
 
Constructor Summary
DeflateDecompressingEntity(HttpEntity entity)
          Creates a new DeflateDecompressingEntity which will wrap the specified HttpEntity.
 
Method Summary
 InputStream getContent()
          
 Header getContentEncoding()
          
 long getContentLength()
          
 void writeTo(OutputStream outstream)
          
 
Methods inherited from class org.apache.http.entity.HttpEntityWrapper
consumeContent, getContentType, isChunked, isRepeatable, isStreaming
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DeflateDecompressingEntity

public DeflateDecompressingEntity(HttpEntity entity)
Creates a new DeflateDecompressingEntity which will wrap the specified HttpEntity.

Parameters:
entity - a non-null HttpEntity to be wrapped
Method Detail

getContentEncoding

public Header getContentEncoding()

Specified by:
getContentEncoding in interface HttpEntity
Overrides:
getContentEncoding in class HttpEntityWrapper

getContentLength

public long getContentLength()

Specified by:
getContentLength in interface HttpEntity
Overrides:
getContentLength in class HttpEntityWrapper

getContent

public InputStream getContent()
                       throws IOException

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

writeTo

public void writeTo(OutputStream outstream)
             throws IOException

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


Copyright © 1999-2012 The Apache Software Foundation. All Rights Reserved.