public class

BufferingNHttpEntity

extends HttpEntityWrapper
implements ConsumingNHttpEntity
java.lang.Object
   ↳ org.apache.http.entity.HttpEntityWrapper
     ↳ org.apache.http.nio.entity.BufferingNHttpEntity

Class Overview

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

Summary

[Expand]
Inherited Fields
From class org.apache.http.entity.HttpEntityWrapper
Public Constructors
BufferingNHttpEntity(HttpEntity httpEntity, ByteBufferAllocator allocator)
Public Methods
void consumeContent(ContentDecoder decoder, IOControl ioctrl)
Notification that content is available to be read from the decoder.
void consumeContent()
void finish()
Notification that any resources allocated for reading can be released.
InputStream getContent()
Obtains entity's content as InputStream.
boolean isRepeatable()
boolean isStreaming()
void writeTo(OutputStream outstream)
[Expand]
Inherited Methods
From class org.apache.http.entity.HttpEntityWrapper
From class java.lang.Object
From interface org.apache.http.HttpEntity
From interface org.apache.http.nio.entity.ConsumingNHttpEntity

Public Constructors

public BufferingNHttpEntity (HttpEntity httpEntity, ByteBufferAllocator allocator)

Public Methods

public void consumeContent (ContentDecoder decoder, IOControl ioctrl)

Notification that content is available to be read from the decoder. IOControl instance passed as a parameter to the method can be used to suspend input events if the entity is temporarily unable to allocate more storage to accommodate all incoming content.

Parameters
decoder content decoder.
ioctrl I/O control of the underlying connection.
Throws
IOException

public void consumeContent ()

Throws
IOException

public void finish ()

Notification that any resources allocated for reading can be released.

public InputStream getContent ()

Obtains entity's content as InputStream.

Throws
IllegalStateException if content of the entity has not been fully received or has already been consumed.
IOException

public boolean isRepeatable ()

public boolean isStreaming ()

public void writeTo (OutputStream outstream)

Throws
IOException