public class

NHttpEntityWrapper

extends HttpEntityWrapper
implements ProducingNHttpEntity
java.lang.Object
   ↳ org.apache.http.entity.HttpEntityWrapper
     ↳ org.apache.http.nio.entity.NHttpEntityWrapper

Class Overview

ProducingNHttpEntity compatibility adaptor for blocking HTTP entities.

Summary

[Expand]
Inherited Fields
From class org.apache.http.entity.HttpEntityWrapper
Public Constructors
NHttpEntityWrapper(HttpEntity httpEntity)
Public Methods
void consumeContent()
This method is equivalent to the finish() method.
void finish()
Notification that any resources allocated for writing can be released.
InputStream getContent()
This method throws UnsupportedOperationException.
boolean isStreaming()
void produceContent(ContentEncoder encoder, IOControl ioctrl)
Notification that content should be written to the encoder.
void writeTo(OutputStream out)
This method throws UnsupportedOperationException.
[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.ProducingNHttpEntity

Public Constructors

public NHttpEntityWrapper (HttpEntity httpEntity)

Throws
IOException

Public Methods

public void consumeContent ()

This method is equivalent to the finish() method.
TODO: The name of this method is misnomer. It will be renamed to #finish() in the next major release.

Throws
IOException

public void finish ()

Notification that any resources allocated for writing can be released.

public InputStream getContent ()

This method throws UnsupportedOperationException.

public boolean isStreaming ()

public void produceContent (ContentEncoder encoder, IOControl ioctrl)

Notification that content should be written to the encoder. IOControl instance passed as a parameter to the method can be used to suspend output events if the entity is temporarily unable to produce more content.

When all content is finished, this MUST call complete(). Failure to do so could result in the entity never being written.

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

public void writeTo (OutputStream out)