public class InputStreamRequestEntity extends java.lang.Object implements RequestEntity
| 限定符和类型 | 字段和说明 |
|---|---|
static int |
CONTENT_LENGTH_AUTO
The content length will be calculated automatically.
|
| 构造器和说明 |
|---|
InputStreamRequestEntity(java.io.InputStream content)
Creates a new InputStreamRequestEntity with the given content and a content category of
CONTENT_LENGTH_AUTO. |
InputStreamRequestEntity(java.io.InputStream content,
long contentLength)
Creates a new InputStreamRequestEntity with the given content and content length.
|
InputStreamRequestEntity(java.io.InputStream content,
long contentLength,
java.lang.String contentType)
Creates a new InputStreamRequestEntity with the given content, content length, and
content category.
|
InputStreamRequestEntity(java.io.InputStream content,
java.lang.String contentType)
Creates a new InputStreamRequestEntity with the given content, content category, and a
content length of
CONTENT_LENGTH_AUTO. |
| 限定符和类型 | 方法和说明 |
|---|---|
java.io.InputStream |
getContent() |
long |
getContentLength()
Gets the content length.
|
java.lang.String |
getContentType()
Gets the entity's content category.
|
boolean |
isRepeatable()
Tests if this method is repeatable.
|
void |
writeRequest(java.io.OutputStream out)
Writes the request entity to the given stream.
|
public static final int CONTENT_LENGTH_AUTO
public InputStreamRequestEntity(java.io.InputStream content)
CONTENT_LENGTH_AUTO.content - The content to set.public InputStreamRequestEntity(java.io.InputStream content,
java.lang.String contentType)
CONTENT_LENGTH_AUTO.content - The content to set.contentType - The category of the content, or null.public InputStreamRequestEntity(java.io.InputStream content,
long contentLength)
content - The content to set.contentLength - The content size in bytes or a negative number if not known.
If CONTENT_LENGTH_AUTO is given the content will be buffered in order to
determine its size when getContentLength() is called.public InputStreamRequestEntity(java.io.InputStream content,
long contentLength,
java.lang.String contentType)
content - The content to set.contentLength - The content size in bytes or a negative number if not known.
If CONTENT_LENGTH_AUTO is given the content will be buffered in order to
determine its size when getContentLength() is called.contentType - The category of the content, or null.public java.lang.String getContentType()
RequestEntitygetContentType 在接口中 RequestEntityHttpMethod.setRequestHeader(String, String)public boolean isRepeatable()
true if the content has been
buffered.isRepeatable 在接口中 RequestEntityOutputStream more than once,
false otherwise.getContentLength()public void writeRequest(java.io.OutputStream out)
throws java.io.IOException
RequestEntitywriteRequest 在接口中 RequestEntityjava.io.IOExceptionpublic long getContentLength()
getContentLength 在接口中 RequestEntitypublic java.io.InputStream getContent()