public final class BufferedRequestEntity extends java.lang.Object implements HttpRequestEntity
HttpRequestEntity, if necessary, to determine the content length before sending
it to the client. Implementations can use this to avoid chunked encoding if the server doesn't support it.| Constructor and Description |
|---|
BufferedRequestEntity(HttpRequestEntity bufferedEntity) |
BufferedRequestEntity(HttpRequestEntity bufferedEntity,
int maxBufferSize) |
| Modifier and Type | Method and Description |
|---|---|
long |
contentLength()
Returns the length of the content or a negative number if it's not known.
|
ContentType |
contentType()
Returns the content type of the entity if known.
|
void |
writeContent(java.io.OutputStream out)
Writes the content to the given
OutputStream. |
public BufferedRequestEntity(HttpRequestEntity bufferedEntity)
public BufferedRequestEntity(HttpRequestEntity bufferedEntity, int maxBufferSize)
public ContentType contentType()
HttpRequestEntitycontentType in interface HttpRequestEntitynull if no content type is applicable (like when the entity is empty).public long contentLength()
throws java.io.IOException
HttpRequestEntitycontentLength in interface HttpRequestEntityjava.io.IOExceptionpublic void writeContent(java.io.OutputStream out)
throws java.io.IOException
HttpRequestEntityOutputStream. Note that the stream is property of the caller and must not be closed by this method.writeContent in interface HttpRequestEntityout - The OutputStream to write to.java.io.IOException