Class Overview
A wrapping entity that buffers it content if necessary.
The buffered entity is always repeatable.
If the wrapped entity is repeatable itself, calls are passed through.
If the wrapped entity is not repeatable, the content is read into a
buffer once and provided from there as often as required.
Summary
Public Methods |
InputStream
|
getContent()
Creates a new InputStream object of the entity.
|
long
|
getContentLength()
Tells the length of the content, if known.
|
boolean
|
isChunked()
Tells that this entity does not have to be chunked.
|
boolean
|
isRepeatable()
Tells that this entity is repeatable.
|
boolean
|
isStreaming()
Tells whether this entity depends on an underlying stream.
|
void
|
writeTo(OutputStream outstream)
Writes the entity content to the output stream.
|
[Expand]
Inherited Methods |
From class org.apache.http.entity.HttpEntityWrapper
|
From class java.lang.Object
Object
|
clone()
Creates and returns a copy of this Object .
|
boolean
|
equals(Object o)
Compares this instance with the specified object and indicates if they
are equal.
|
void
|
finalize()
Is called before the object's memory is being reclaimed by the VM.
|
final
Class<? extends Object>
|
getClass()
Returns the unique instance of Class which represents this
object's class.
|
int
|
hashCode()
Returns an integer hash code for this object.
|
final
void
|
notify()
Causes a thread which is waiting on this object's monitor (by means of
calling one of the wait() methods) to be woken up.
|
final
void
|
notifyAll()
Causes all threads which are waiting on this object's monitor (by means
of calling one of the wait() methods) to be woken up.
|
String
|
toString()
Returns a string containing a concise, human-readable description of this
object.
|
final
void
|
wait(long millis, int nanos)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
final
void
|
wait(long millis)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
final
void
|
wait()
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.
|
|
From interface org.apache.http.HttpEntity
abstract
void
|
consumeContent()
TODO: The name of this method is misnomer.
|
abstract
InputStream
|
getContent()
Creates a new InputStream object of the entity.
|
abstract
Header
|
getContentEncoding()
Obtains the Content-Encoding header, if known.
|
abstract
long
|
getContentLength()
Tells the length of the content, if known.
|
abstract
Header
|
getContentType()
Obtains the Content-Type header, if known.
|
abstract
boolean
|
isChunked()
Tells about chunked encoding for this entity.
|
abstract
boolean
|
isRepeatable()
Tells if the entity is capable to produce its data more than once.
|
abstract
boolean
|
isStreaming()
Tells whether this entity depends on an underlying stream.
|
abstract
void
|
writeTo(OutputStream outstream)
Writes the entity content to the output stream.
|
|
Public Constructors
Public Methods
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
will throw an exception if this method is called multiple times.
Returns
- a new input stream that returns the entity data.
public
long
getContentLength
()
Tells the length of the content, if known.
Returns
- the number of bytes of the content, or
a negative number if unknown. If the content length is known
but exceeds Long.MAX_VALUE,
a negative number is returned.
public
boolean
isChunked
()
Tells that this entity does not have to be chunked.
public
boolean
isRepeatable
()
Tells that this entity is repeatable.
public
boolean
isStreaming
()
Tells whether this entity depends on an underlying stream.
Streamed entities should return true
until the
content has been consumed, false
afterwards.
Self-contained entities should return false
.
Wrapping entities should delegate this call to the wrapped entity.
The content of a streamed entity is consumed when the stream
returned by getContent has been read to EOF,
or after consumeContent has been called.
If a streamed entity can not detect whether the stream has been
read to EOF, it should return true
until
consumeContent is called.
Returns
true
if the entity content is streamed and
not yet consumed, false
otherwise
public
void
writeTo
(OutputStream outstream)
Writes the entity content to the output stream.
Parameters
outstream
| the output stream to write entity content to |