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

Quick Search    Search Deep

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

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

public class StringEntity
extends AbstractHttpEntity

A self-contained entity obtaining content from a string.

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
StringEntity(java.lang.String s)
           
StringEntity(java.lang.String s, java.lang.String charset)
           
 
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

StringEntity

public StringEntity(java.lang.String s,
                    java.lang.String charset)
             throws java.io.UnsupportedEncodingException

StringEntity

public StringEntity(java.lang.String s)
             throws java.io.UnsupportedEncodingException
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()
                               throws java.io.IOException
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.