Module jakarta.mail

Class PreencodedMimeBodyPart

  • All Implemented Interfaces:
    MimePart, Part

    public class PreencodedMimeBodyPart
    extends MimeBodyPart
    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.
    • Constructor Detail

      • PreencodedMimeBodyPart

        public PreencodedMimeBodyPart​(java.lang.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.
        encoding - the Content-Transfer-Encoding
    • Method Detail

      • writeTo

        public void writeTo​( os)
        Output the body part as an RFC 822 format stream.
        Specified by:
        writeTo in interface Part
        writeTo in class MimeBodyPart
        os - the stream to write to
        Throws: - if an error occurs writing to the stream or if an error is generated by the jakarta.activation layer.
        MessagingException - for other failures
        See Also: