org.apache.http.entity.BasicHttpEntity
A generic streamed entity being received on a connection.
Summary
Public Constructors
Public Methods
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
Details
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)
Specifies the content.
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
|