Class Overview
A generic streamed entity being received on a connection.
Summary
[Expand]
Inherited Methods |
From class
org.apache.http.entity.AbstractHttpEntity
|
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()
Invoked when the garbage collector has detected that this instance is no longer reachable.
|
final
Class<?>
|
getClass()
Returns the unique instance of Class that 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()
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method 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.
|
|
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
BasicHttpEntity
()
Creates a new basic entity.
The content is initially missing, the content length
is set to a negative number.
Public Methods
public
void
consumeContent
()
Does not consume anything.
The default implementation does nothing if
isStreaming
returns false
, and throws an exception
if it returns true
.
This removes the burden of implementing
an empty method for non-streaming entities.
Obtains the content, once only.
Returns
- the content, if this is the first call to this method
since
setContent
has been called
public
long
getContentLength
()
public
boolean
isRepeatable
()
Tells that this entity is not repeatable.
public
boolean
isStreaming
()
public
void
setContent
(InputStream instream)
Parameters
instream
| the stream to return with the next call to
getContent
|
public
void
setContentLength
(long len)
Specifies the length of the content.
Parameters
len
| the number of bytes in the content, or
a negative number to indicate an unknown length
|