Top Description Fields Constructors Methods
javax.mail.internet

public Class PreencodedMimeBodyPart

extends MimeBodyPart
Class Inheritance
Imports
java.io.*, java.util.Enumeration, javax.mail.*, com.sun.mail.util.LineOutputStream

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.
Since
JavaMail 1.4

Field Summary

Modifier and TypeField and Description
private String
Inherited from javax.mail.internet.MimeBodyPart:
cachedContentcacheMultipartcontentcontentStreamdhheaders

Constructor Summary

AccessConstructor and Description
public
PreencodedMimeBodyPart(String
the Content-Transfer-Encoding
encoding
)

Create a PreencodedMimeBodyPart that assumes the data is encoded using the specified encoding.

Method Summary

Modifier and TypeMethod and Description
public String
getEncoding()

Overrides javax.mail.internet.MimeBodyPart.getEncoding.

Implements javax.mail.internet.MimePart.getEncoding.

Returns the content transfer encoding specified when this object was created.
protected void
updateHeaders()

Overrides javax.mail.internet.MimeBodyPart.updateHeaders.

Force the Content-Transfer-Encoding header to use the encoding that was specified when this object was created.
public void
writeTo(OutputStream
the stream to write to
os
)

Overrides javax.mail.internet.MimeBodyPart.writeTo.

Implements javax.mail.Part.writeTo.

Output the body part as an RFC 822 format stream.
Inherited from javax.mail.internet.MimeBodyPart:
addHeaderaddHeaderLineattachFileattachFileattachFileattachFilegetAllHeaderLinesgetAllHeadersgetContentgetContentIDgetContentLanguagegetContentLanguagegetContentMD5getContentStreamgetContentTypegetDataHandlergetDescriptiongetDescriptiongetDispositiongetDispositiongetEncodinggetFileNamegetFileNamegetHeadergetHeadergetInputStreamgetLineCountgetMatchingHeaderLinesgetMatchingHeadersgetNonMatchingHeaderLinesgetNonMatchingHeadersgetRawInputStreamgetSizeinvalidateContentHeadersisMimeTypeisMimeTyperemoveHeaderrestrictEncodingsaveFilesaveFilesetContentsetContentsetContentIDsetContentLanguagesetContentLanguagesetContentMD5setDataHandlersetDescriptionsetDescriptionsetDescriptionsetDispositionsetDispositionsetEncodingsetFileNamesetFileNamesetHeadersetTextsetTextsetTextsetTextupdateHeaderswriteTo

Field Detail

encodingback to summary
private String encoding

Constructor Detail

PreencodedMimeBodyPartback to summary
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:String

the Content-Transfer-Encoding

Method Detail

getEncodingback to summary
public String getEncoding() throws MessagingException

Overrides javax.mail.internet.MimeBodyPart.getEncoding.

Implements javax.mail.internet.MimePart.getEncoding.

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

Returns:String

Doc from javax.mail.internet.MimePart.getEncoding.

content-transfer-encoding

Annotations
@Override
Exceptions
MessagingException:

Doc from javax.mail.internet.MimePart.getEncoding.

for failures

updateHeadersback to summary
protected void updateHeaders() throws MessagingException

Overrides javax.mail.internet.MimeBodyPart.updateHeaders.

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

Annotations
@Override
Exceptions
MessagingException:

Doc from javax.mail.internet.MimeBodyPart.updateHeaders.

for failures

writeToback to summary
public void writeTo(OutputStream os) throws IOException, MessagingException

Overrides javax.mail.internet.MimeBodyPart.writeTo.

Implements javax.mail.Part.writeTo.

Output the body part as an RFC 822 format stream.

Parameters
os:OutputStream

Doc from javax.mail.Part.writeTo.

the stream to write to

Annotations
@Override
Exceptions
IOException:
if an error occurs writing to the stream or if an error is generated by the javax.activation layer.
MessagingException:
for other failures
See Also
javax.activation.DataHandler#writeTo