public class ByteArrayRequestEntity extends java.lang.Object implements RequestEntity
| 构造器和说明 |
|---|
ByteArrayRequestEntity(byte[] content)
Creates a new entity with the given content.
|
ByteArrayRequestEntity(byte[] content,
java.lang.String contentType)
Creates a new entity with the given content and content category.
|
| 限定符和类型 | 方法和说明 |
|---|---|
byte[] |
getContent() |
long |
getContentLength()
Gets the request entity's length.
|
java.lang.String |
getContentType()
Gets the entity's content category.
|
boolean |
isRepeatable()
Tests if
RequestEntity.writeRequest(OutputStream) can be called more than once. |
void |
writeRequest(java.io.OutputStream out)
Writes the request entity to the given stream.
|
public ByteArrayRequestEntity(byte[] content)
content - The content to set.public ByteArrayRequestEntity(byte[] content,
java.lang.String contentType)
content - The content to set.contentType - The content category to set or null.public boolean isRepeatable()
RequestEntityRequestEntity.writeRequest(OutputStream) can be called more than once.isRepeatable 在接口中 RequestEntitytruepublic java.lang.String getContentType()
RequestEntitygetContentType 在接口中 RequestEntityHttpMethod.setRequestHeader(String, String)public void writeRequest(java.io.OutputStream out)
throws java.io.IOException
RequestEntitywriteRequest 在接口中 RequestEntityjava.io.IOExceptionpublic long getContentLength()
RequestEntityEntityEnclosingMethod will use chunk encoding to
transmit the request entity.getContentLength 在接口中 RequestEntitypublic byte[] getContent()