public class

PreencodedMimeBodyPart

extends MimeBodyPart
java.lang.Object
   ↳ com.google.code.javax.mail.BodyPart
     ↳ com.google.code.javax.mail.internet.MimeBodyPart
       ↳ com.google.code.javax.mail.internet.PreencodedMimeBodyPart

Class Overview

A MimeBodyPart that handles data that has already been encoded. This class is useful when constructing a message and attaching data that has already been encoded (for example, using base64 encoding). The data may have been encoded by the application, or may have been stored in a file or database in encoded form. The encoding is supplied when this object is created. The data is attached to this object in the usual fashion, by using the setText, setContent, or setDataHandler methods.

Summary

[Expand]
Inherited Constants
From interface com.google.code.javax.mail.Part
Fields
private String encoding
[Expand]
Inherited Fields
From class com.google.code.javax.mail.internet.MimeBodyPart
From class com.google.code.javax.mail.BodyPart
Public Constructors
PreencodedMimeBodyPart(String encoding)
Create a PreencodedMimeBodyPart that assumes the data is encoded using the specified encoding.
Public Methods
String getEncoding()
Returns the content transfer encoding specified when this object was created.
void writeTo(OutputStream os)
Output the body part as an RFC 822 format stream.
Protected Methods
void updateHeaders()
Force the Content-Transfer-Encoding header to use the encoding that was specified when this object was created.
[Expand]
Inherited Methods
From class com.google.code.javax.mail.internet.MimeBodyPart
From class com.google.code.javax.mail.BodyPart
From class java.lang.Object
From interface com.google.code.javax.mail.HasRawInputStream
From interface com.google.code.javax.mail.Part
From interface com.google.code.javax.mail.internet.MimePart

Fields

private String encoding

Public Constructors

public PreencodedMimeBodyPart (String encoding)

Create a PreencodedMimeBodyPart that assumes the data is encoded using the specified encoding. The encoding must be a MIME supported Content-Transfer-Encoding.

Parameters
encoding

Public Methods

public String getEncoding ()

Returns the content transfer encoding specified when this object was created.

Returns
  • content-transfer-encoding

public void writeTo (OutputStream os)

Output the body part as an RFC 822 format stream.

Parameters
os
Throws
IOException if an error occurs writing to the stream or if an error is generated by the javax.activation layer.
MessagingException

Protected Methods

protected void updateHeaders ()

Force the Content-Transfer-Encoding header to use the encoding that was specified when this object was created.