public class TemporaryBufferEntity
extends org.apache.http.entity.AbstractHttpEntity
implements java.lang.AutoCloseable
HttpEntity
which takes its content from a
TemporaryBuffer
Modifier and Type | Field and Description |
---|---|
private TemporaryBuffer |
buffer |
private java.lang.Integer |
contentLength |
Constructor and Description |
---|
TemporaryBufferEntity(TemporaryBuffer buffer)
Construct a new
HttpEntity which will contain the
content stored in the specified buffer |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close destroys the associated buffer used to buffer the entity
|
TemporaryBuffer |
getBuffer()
Get the
buffer containing the content |
java.io.InputStream |
getContent() |
long |
getContentLength() |
boolean |
isRepeatable() |
boolean |
isStreaming() |
void |
setContentLength(int contentLength)
Set the
contentLength |
void |
writeTo(java.io.OutputStream outstream) |
private TemporaryBuffer buffer
private java.lang.Integer contentLength
public TemporaryBufferEntity(TemporaryBuffer buffer)
HttpEntity
which will contain the
content stored in the specified bufferbuffer
- public TemporaryBuffer getBuffer()
buffer
containing the contentpublic boolean isRepeatable()
isRepeatable
in interface org.apache.http.HttpEntity
public long getContentLength()
getContentLength
in interface org.apache.http.HttpEntity
public java.io.InputStream getContent() throws java.io.IOException, java.lang.IllegalStateException
getContent
in interface org.apache.http.HttpEntity
java.io.IOException
java.lang.IllegalStateException
public void writeTo(java.io.OutputStream outstream) throws java.io.IOException
writeTo
in interface org.apache.http.HttpEntity
java.io.IOException
public boolean isStreaming()
isStreaming
in interface org.apache.http.HttpEntity
public void setContentLength(int contentLength)
contentLength
contentLength
- public void close()
close
in interface java.lang.AutoCloseable