public class ByteArrayBody extends AbstractContentBody
Description:
| 构造器和说明 |
|---|
ByteArrayBody(byte[] data,
ContentType contentType,
String filename) |
ByteArrayBody(byte[] data,
String filename)
Creates a new ByteArrayBody.
|
ByteArrayBody(byte[] data,
String mimeType,
String filename)
Creates a new ByteArrayBody.
|
| 限定符和类型 | 方法和说明 |
|---|---|
String |
getCharset()
The body descriptors character set, defaulted appropriately for the MIME
type.
|
long |
getContentLength()
Returns the body descriptors content-length.
|
String |
getFilename() |
String |
getTransferEncoding()
Returns the body descriptors transfer encoding.
|
void |
writeTo(OutputStream out) |
getContentType, getMimeTypepublic ByteArrayBody(byte[] data,
String mimeType,
String filename)
data - The contents of the file contained in this part.mimeType - The MIME type of the file contained in this part.filename - The name of the file contained in this part.public ByteArrayBody(byte[] data,
ContentType contentType,
String filename)
public ByteArrayBody(byte[] data,
String filename)
data - The contents of the file contained in this part.filename - The name of the file contained in this part.public String getFilename()
public void writeTo(OutputStream out) throws IOException
IOExceptionpublic String getCharset()
ContentBodyThe body descriptors character set, defaulted appropriately for the MIME type.
For TEXT types, this will be defaulted to us-ascii. For
other types, when the charset parameter is missing this property will be
null.
getCharset 在接口中 ContentBodygetCharset 在类中 AbstractContentBodyTEXT types, when unset will be
set to default us-ascii. For other types, when unset,
null will be returned.public String getTransferEncoding()
ContentBodypublic long getContentLength()
ContentBodyCopyright © 2019. All rights reserved.