|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.rim.blackberry.api.mail.BodyPart
net.rim.blackberry.api.mail.TextBodyPart
public class TextBodyPart
Body part with "text/plain" content-type.
This class is used when creating a multipart message that includes a text/plain part.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class net.rim.blackberry.api.mail.BodyPart |
---|
BodyPart.ContentType |
Field Summary | ||
---|---|---|
|
static String |
TEXT_PLAIN
Deprecated. Use TextBodyPart.getTextPlainContentType() . |
Fields inherited from class net.rim.blackberry.api.mail.BodyPart |
---|
CONTENT_TYPE, CRLF, EMPTY, SEPARATOR |
Fields inherited from interface net.rim.blackberry.api.mail.Part |
---|
ATTACHMENT, INLINE |
Constructor Summary | ||
---|---|---|
|
TextBodyPart(Multipart multipart)
Creates a new, emtpy TextBodyPart instance. |
|
|
TextBodyPart(Multipart mp,
String text)
Creates a new TextBodyPart instance with provided contents. |
Method Summary | ||
---|---|---|
|
Object |
getContent()
Retrieves this body part's contents. |
|
InputStream |
getInputStream()
Retrieves a stream representation of this body part's contents. |
|
int |
getSize()
Retrieves the length of this body part's contents. |
|
static String |
getTextPlainContentType()
Retrieves the text/plain content-type name as a string. |
|
boolean |
hasMore()
Determines if more data for this body part is available on the server. |
|
void |
setContent(Object content)
Sets this body part's contents. |
|
void |
writeTo(OutputStream out)
Writes this body part's contents to an output stream. |
Methods inherited from class net.rim.blackberry.api.mail.BodyPart |
---|
addHeader, getAllHeaders, getContentType, getHeader, getParent, isMimeType, moreRequestSent, removeHeader, setContentType, setHeader |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static String TEXT_PLAIN
TextBodyPart.getTextPlainContentType()
.
Constructor Detail |
---|
public TextBodyPart(Multipart multipart)
multipart
- Multipart to contain the new text body part.public TextBodyPart(Multipart mp, String text)
mp
- Multipart to contain the new text body part.text
- Text to use for body contents.Method Detail |
---|
public static String getTextPlainContentType()
This value can change during execution, hence a method to retrieve it's value. Call this method when requesting the default content type to ensure you have the most up to date value.
public InputStream getInputStream()
public void setContent(Object content)
content
- Object to use as this part's contents; must be
a String
, or treatable as such.public Object getContent()
String
form.public int getSize()
public void writeTo(OutputStream out) throws IOException
This method first writes two CRLF pairs to the output stream and then writes out this body part's contents as a raw list of bytes.
writeTo
in interface Part
writeTo
in class BodyPart
out
- Output stream to receive this part's contents.
IOException
- If an I/O exception occurs.public boolean hasMore()
hasMore
in class BodyPart
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal