org.apache.http.entity
Class SerializableEntityHC4

java.lang.Object
  extended by org.apache.http.entity.AbstractHttpEntityHC4
      extended by org.apache.http.entity.SerializableEntityHC4
All Implemented Interfaces:
org.apache.http.HttpEntity

@NotThreadSafe
public class SerializableEntityHC4
extends AbstractHttpEntityHC4

A streamed entity that obtains its content from a Serializable. The content obtained from the Serializable instance can optionally be buffered in a byte array in order to make the entity self-contained and repeatable.

Since:
4.0

Field Summary
 
Fields inherited from class org.apache.http.entity.AbstractHttpEntityHC4
chunked, contentEncoding, contentType, OUTPUT_BUFFER_SIZE
 
Constructor Summary
SerializableEntityHC4(java.io.Serializable ser)
           
SerializableEntityHC4(java.io.Serializable ser, boolean bufferize)
          Creates new instance of this class.
 
Method Summary
 java.io.InputStream getContent()
           
 long getContentLength()
           
 boolean isRepeatable()
           
 boolean isStreaming()
           
 void writeTo(java.io.OutputStream outstream)
           
 
Methods inherited from class org.apache.http.entity.AbstractHttpEntityHC4
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
 

Constructor Detail

SerializableEntityHC4

public SerializableEntityHC4(java.io.Serializable ser,
                             boolean bufferize)
                      throws java.io.IOException
Creates new instance of this class.

Parameters:
ser - input
bufferize - tells whether the content should be stored in an internal buffer
Throws:
java.io.IOException - in case of an I/O error

SerializableEntityHC4

public SerializableEntityHC4(java.io.Serializable ser)
Since:
4.3
Method Detail

getContent

public java.io.InputStream getContent()
                               throws java.io.IOException,
                                      java.lang.IllegalStateException
Throws:
java.io.IOException
java.lang.IllegalStateException

getContentLength

public long getContentLength()

isRepeatable

public boolean isRepeatable()

isStreaming

public boolean isStreaming()

writeTo

public void writeTo(java.io.OutputStream outstream)
             throws java.io.IOException
Throws:
java.io.IOException