public class

NByteArrayEntity

extends AbstractHttpEntity
implements ProducingNHttpEntity
java.lang.Object
   ↳ org.apache.http.entity.AbstractHttpEntity
     ↳ org.apache.http.nio.entity.NByteArrayEntity

Class Overview

A simple self contained, repeatable non-blocking entity that retrieves its content from a byte array.

Summary

Fields
protected final ByteBuffer buffer
protected final byte[] content
[Expand]
Inherited Fields
From class org.apache.http.entity.AbstractHttpEntity
Public Constructors
NByteArrayEntity(byte[] b)
Public Methods
void finish()
Notification that any resources allocated for writing can be released.
InputStream getContent()
long getContentLength()
boolean isRepeatable()
boolean isStreaming()
void produceContent(ContentEncoder encoder, IOControl ioctrl)
Notification that content should be written to the encoder.
void writeTo(OutputStream outstream)
[Expand]
Inherited Methods
From class org.apache.http.entity.AbstractHttpEntity
From class java.lang.Object
From interface org.apache.http.HttpEntity
From interface org.apache.http.nio.entity.ProducingNHttpEntity

Fields

protected final ByteBuffer buffer

protected final byte[] content

Public Constructors

public NByteArrayEntity (byte[] b)

Public Methods

public void finish ()

Notification that any resources allocated for writing can be released.

public InputStream getContent ()

public long getContentLength ()

public boolean isRepeatable ()

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

Throws
IOException