org.apache.http.nio.entity
Class BufferingNHttpEntity

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

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

A ConsumingNHttpEntity that consumes content into a buffer. The content can be retrieved as an InputStream via HttpEntity.getContent(), or written to an output stream via HttpEntity.writeTo(OutputStream).


Field Summary
 
Fields inherited from class org.apache.http.entity.HttpEntityWrapper
wrappedEntity
 
Constructor Summary
BufferingNHttpEntity(org.apache.http.HttpEntity httpEntity, ByteBufferAllocator allocator)
           
 
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()
           
 boolean isRepeatable()
           
 boolean isStreaming()
           
 void writeTo(java.io.OutputStream outstream)
           
 
Methods inherited from class org.apache.http.entity.HttpEntityWrapper
getContentEncoding, getContentLength, getContentType, isChunked
 
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
 

Constructor Detail

BufferingNHttpEntity

public BufferingNHttpEntity(org.apache.http.HttpEntity httpEntity,
                            ByteBufferAllocator allocator)
Method Detail

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

consumeContent

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

getContent

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

isRepeatable

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

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 outstream)
             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


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