public class InputStreamRequestEntity extends Object implements RequestEntity
| 限定符和类型 | 字段和说明 |
|---|---|
static int |
CONTENT_LENGTH_AUTO
The content length will be calculated automatically.
|
| 构造器和说明 |
|---|
InputStreamRequestEntity(InputStream content)
Creates a new InputStreamRequestEntity with the given content and a content type of
CONTENT_LENGTH_AUTO. |
InputStreamRequestEntity(InputStream content,
long contentLength)
Creates a new InputStreamRequestEntity with the given content and content length.
|
InputStreamRequestEntity(InputStream content,
long contentLength,
String contentType)
Creates a new InputStreamRequestEntity with the given content, content length, and
content type.
|
InputStreamRequestEntity(InputStream content,
String contentType)
Creates a new InputStreamRequestEntity with the given content, content type, and a
content length of
CONTENT_LENGTH_AUTO. |
| 限定符和类型 | 方法和说明 |
|---|---|
InputStream |
getContent() |
long |
getContentLength()
Gets the content length.
|
String |
getContentType()
Gets the entity's content type.
|
boolean |
isRepeatable()
Tests if this method is repeatable.
|
void |
writeRequest(OutputStream out)
Writes the request entity to the given stream.
|
public static final int CONTENT_LENGTH_AUTO
public InputStreamRequestEntity(InputStream content)
CONTENT_LENGTH_AUTO.content - The content to set.public InputStreamRequestEntity(InputStream content, String contentType)
CONTENT_LENGTH_AUTO.content - The content to set.contentType - The type of the content, or null.public InputStreamRequestEntity(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(InputStream content, long contentLength, 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 type of the content, or null.public String getContentType()
RequestEntitygetContentType 在接口中 RequestEntitycom.ptteng.mall.order.util.apacheCommonUtil.httpclient.HttpMethod#setRequestHeader(String, String)public boolean isRepeatable()
true if the content has been
buffered.isRepeatable 在接口中 RequestEntityOutputStream more than once,
false otherwise.getContentLength()public void writeRequest(OutputStream out) throws IOException
RequestEntitywriteRequest 在接口中 RequestEntityIOExceptionpublic long getContentLength()
getContentLength 在接口中 RequestEntitypublic InputStream getContent()
Copyright © 2017. All rights reserved.