public class ByteArrayBody extends AbstractContentBody
MultipartEntityBuilder
Modifier and Type | Field and Description |
---|---|
private byte[] |
data
The contents of the file contained in this part.
|
private java.lang.String |
filename
The name of the file contained in this part.
|
Constructor and Description |
---|
ByteArrayBody(byte[] data,
org.apache.http.entity.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)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getCharset()
The body descriptors character set, defaulted appropriately for the MIME type.
|
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
private final byte[] data
private final java.lang.String filename
@Deprecated public ByteArrayBody(byte[] data, java.lang.String mimeType, java.lang.String filename)
ByteArrayBody(byte[], ContentType, String)
or MultipartEntityBuilder
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, org.apache.http.entity.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.IOException
public java.lang.String getCharset()
ContentDescriptor
The 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
in interface ContentDescriptor
getCharset
in class AbstractContentBody
TEXT
types, when unset will
be set to default us-ascii
. For other types, when unset,
null will be returned.public java.lang.String getTransferEncoding()
ContentDescriptor
public long getContentLength()
ContentDescriptor