public class ByteArrayBody extends AbstractContentBody
MultipartEntityBuilder| Constructor and Description |
|---|
ByteArrayBody(byte[] data,
org.apache.hc.core5.http.ContentType contentType)
Public constructor that creates a new ByteArrayBody.
|
ByteArrayBody(byte[] data,
org.apache.hc.core5.http.ContentType contentType,
String filename) |
ByteArrayBody(byte[] data,
String filename)
Creates a new ByteArrayBody.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getCharset()
The body descriptors character set, defaulted appropriately for the MIME type.
|
long |
getContentLength()
Returns the body descriptors content-length.
|
String |
getFilename() |
void |
writeTo(OutputStream out) |
getContentType, getMediaType, getMimeType, getSubTypepublic ByteArrayBody(byte[] data,
org.apache.hc.core5.http.ContentType contentType,
String filename)
public ByteArrayBody(byte[] data,
org.apache.hc.core5.http.ContentType contentType)
contentType - the ContentTypedata - the array of byte.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()
ContentDescriptorThe 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 ContentDescriptorgetCharset in class AbstractContentBodyTEXT types, when unset will
be set to default us-ascii. For other types, when unset,
null will be returned.public long getContentLength()
ContentDescriptorCopyright © 1999–2021 The Apache Software Foundation. All rights reserved.