FileDocCategorySizeDatePackage
TextBody.javaAPI DocAndroid 1.5 API1812Wed May 06 22:42:46 BST 2009com.android.email.mail.internet

TextBody

public class TextBody extends Object implements com.android.email.mail.Body

Fields Summary
String
mBody
Constructors Summary
public TextBody(String body)

        this.mBody = body;
    
Methods Summary
public java.io.InputStreamgetInputStream()
Returns an InputStream that reads this body's text in UTF-8 format.

        try {
            byte[] b = mBody.getBytes("UTF-8");
            return new ByteArrayInputStream(b);
        }
        catch (UnsupportedEncodingException usee) {
            return null;
        }
    
public java.lang.StringgetText()
Get the text of the body in it's unencoded format.

return

        return mBody;
    
public voidwriteTo(java.io.OutputStream out)

        byte[] bytes = mBody.getBytes("UTF-8");
        out.write(Base64.encodeBase64Chunked(bytes));