public class ByteArrayBody extends AbstractContentBody
MultipartEntityBuilder| 构造器和说明 |
|---|
ByteArrayBody(byte[] data,
ContentType contentType,
java.lang.String filename) |
ByteArrayBody(byte[] data,
java.lang.String filename)
Creates a new ByteArrayBody.
|
ByteArrayBody(byte[] data,
java.lang.String mimeType,
java.lang.String filename)
已过时。
|
| 限定符和类型 | 方法和说明 |
|---|---|
java.lang.String |
getCharset()
The body descriptors character set, defaulted appropriately for the MIME category.
|
long |
getContentLength()
Returns the body descriptors content-length.
|
java.lang.String |
getFilename() |
java.lang.String |
getTransferEncoding()
Returns the body descriptors transfer encoding.
|
void |
writeTo(java.io.OutputStream out) |
getContentType, getMediaType, getMimeType, getSubType@Deprecated
public ByteArrayBody(byte[] data,
java.lang.String mimeType,
java.lang.String filename)
data - The contents of the file contained in this part.mimeType - The MIME category of the file contained in this part.filename - The name of the file contained in this part.public ByteArrayBody(byte[] data,
ContentType contentType,
java.lang.String filename)
public ByteArrayBody(byte[] data,
java.lang.String filename)
data - The contents of the file contained in this part.filename - The name of the file contained in this part.public java.lang.String getFilename()
public void writeTo(java.io.OutputStream out)
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String getCharset()
ContentDescriptorThe body descriptors character set, defaulted appropriately for the MIME category.
For TEXT types, this will be defaulted to us-ascii.
For extension types, when the charset parameter is missing this property will be null.
getCharset 在接口中 ContentDescriptorgetCharset 在类中 AbstractContentBodyTEXT types, when unset will
be set to default us-ascii. For extension types, when unset,
null will be returned.public java.lang.String getTransferEncoding()
ContentDescriptorpublic long getContentLength()
ContentDescriptor