Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.http.entity
Class ByteArrayEntity  view ByteArrayEntity download ByteArrayEntity.java

java.lang.Object
  extended byorg.apache.http.entity.AbstractHttpEntity
      extended byorg.apache.http.entity.ByteArrayEntity
All Implemented Interfaces:
org.apache.http.HttpEntity

public class ByteArrayEntity
extends AbstractHttpEntity

A self-contained entity obtaining content from a byte array.

Since:
4.0
Version:
$Revision: 376458 $

Field Summary
private  byte[] content
           
 
Fields inherited from class org.apache.http.entity.AbstractHttpEntity
chunked, contentEncoding, contentType
 
Constructor Summary
ByteArrayEntity(byte[] b)
           
 
Method Summary
 java.io.InputStream getContent()
          Creates a new InputStream object of the entity.
 long getContentLength()
          Tells the length of the content, if known.
 boolean isRepeatable()
          Tells if the entity is capable to produce its data more than once.
 boolean isStreaming()
          Tells that this entity is not streaming.
 void writeTo(java.io.OutputStream outstream)
          Writes the entity content to the output stream.
 
Methods inherited from class org.apache.http.entity.AbstractHttpEntity
consumeContent, getContentEncoding, getContentType, isChunked, setChunked, setContentEncoding, setContentEncoding, setContentType, setContentType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

content

private final byte[] content
Constructor Detail

ByteArrayEntity

public ByteArrayEntity(byte[] b)
Method Detail

isRepeatable

public boolean isRepeatable()
Description copied from interface: org.apache.http.HttpEntity
Tells if the entity is capable to produce its data more than once. A repeatable entity's getContent() and writeTo(OutputStream) methods can be called more than once whereas a non-repeatable entity's can not.


getContentLength

public long getContentLength()
Description copied from interface: org.apache.http.HttpEntity
Tells the length of the content, if known.


getContent

public java.io.InputStream getContent()
Description copied from interface: org.apache.http.HttpEntity
Creates a new InputStream object of the entity. It is a programming error to return the same InputStream object more than once. Entities that are not repeatable 55 will throw an exception if this method is called multiple times.


writeTo

public void writeTo(java.io.OutputStream outstream)
             throws java.io.IOException
Description copied from interface: org.apache.http.HttpEntity
Writes the entity content to the output stream.


isStreaming

public boolean isStreaming()
Tells that this entity is not streaming.