org.apache.http.nio.entity
Class ConsumingNHttpEntityTemplate

java.lang.Object
  extended by org.apache.http.entity.HttpEntityWrapper
      extended by org.apache.http.nio.entity.ConsumingNHttpEntityTemplate
All Implemented Interfaces:
org.apache.http.HttpEntity, ConsumingNHttpEntity

public class ConsumingNHttpEntityTemplate
extends org.apache.http.entity.HttpEntityWrapper
implements ConsumingNHttpEntity

A ConsumingNHttpEntity that forwards available content to a ContentListener.


Field Summary
 
Fields inherited from class org.apache.http.entity.HttpEntityWrapper
wrappedEntity
 
Constructor Summary
ConsumingNHttpEntityTemplate(org.apache.http.HttpEntity httpEntity, ContentListener contentListener)
           
 
Method Summary
 void consumeContent()
           
 void consumeContent(ContentDecoder decoder, IOControl ioctrl)
          Notification that content is available to be read from the decoder.
 void finish()
          Notification that any resources allocated for reading can be released.
 java.io.InputStream getContent()
           
 ContentListener getContentListener()
           
 boolean isStreaming()
           
 void writeTo(java.io.OutputStream out)
           
 
Methods inherited from class org.apache.http.entity.HttpEntityWrapper
getContentEncoding, getContentLength, getContentType, isChunked, isRepeatable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.http.HttpEntity
getContentEncoding, getContentLength, getContentType, isChunked, isRepeatable
 

Constructor Detail

ConsumingNHttpEntityTemplate

public ConsumingNHttpEntityTemplate(org.apache.http.HttpEntity httpEntity,
                                    ContentListener contentListener)
Method Detail

getContentListener

public ContentListener getContentListener()

getContent

public java.io.InputStream getContent()
                               throws java.io.IOException,
                                      java.lang.IllegalStateException
Specified by:
getContent in interface org.apache.http.HttpEntity
Overrides:
getContent in class org.apache.http.entity.HttpEntityWrapper
Throws:
java.io.IOException
java.lang.IllegalStateException

isStreaming

public boolean isStreaming()
Specified by:
isStreaming in interface org.apache.http.HttpEntity
Overrides:
isStreaming in class org.apache.http.entity.HttpEntityWrapper

writeTo

public void writeTo(java.io.OutputStream out)
             throws java.io.IOException
Specified by:
writeTo in interface org.apache.http.HttpEntity
Overrides:
writeTo in class org.apache.http.entity.HttpEntityWrapper
Throws:
java.io.IOException

consumeContent

public void consumeContent()
                    throws java.io.IOException,
                           java.lang.UnsupportedOperationException
Specified by:
consumeContent in interface org.apache.http.HttpEntity
Overrides:
consumeContent in class org.apache.http.entity.HttpEntityWrapper
Throws:
java.io.IOException
java.lang.UnsupportedOperationException

consumeContent

public void consumeContent(ContentDecoder decoder,
                           IOControl ioctrl)
                    throws java.io.IOException
Description copied from interface: ConsumingNHttpEntity
Notification that content is available to be read from the decoder.

Specified by:
consumeContent in interface ConsumingNHttpEntity
Throws:
java.io.IOException

finish

public void finish()
Description copied from interface: ConsumingNHttpEntity
Notification that any resources allocated for reading can be released.

Specified by:
finish in interface ConsumingNHttpEntity


Copyright © 2005-2008 Apache Software Foundation. All Rights Reserved.