|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.http.entity.mime.content.AbstractContentBody
org.apache.http.entity.mime.content.ByteArrayBody
public class ByteArrayBody
Body part that is built using a byte array containing a file.
Constructor Summary | |
---|---|
ByteArrayBody(byte[] data,
String filename)
Creates a new ByteArrayBody. |
|
ByteArrayBody(byte[] data,
String mimeType,
String filename)
Creates a new ByteArrayBody. |
Method Summary | |
---|---|
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)
|
Methods inherited from class org.apache.http.entity.mime.content.AbstractContentBody |
---|
getMediaType, getMimeType, getSubType |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public 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, String filename)
data
- The contents of the file contained in this part.filename
- The name of the file contained in this part.Method Detail |
---|
public String getFilename()
public void writeTo(OutputStream out) throws IOException
IOException
public 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.
TEXT
types, when unset will
be set to default us-ascii
. For other types, when unset,
null will be returned.public String getTransferEncoding()
ContentDescriptor
public long getContentLength()
ContentDescriptor
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |