getDataHandler().writeTo(MimeUtility.encode(out, getEncoding()));
OutputStream encodingStream = MimeUtility.encode(out, getEncoding()); getDataHandler().writeTo(encodingStream); encodingStream.flush();
    public void writeTo(OutputStream out) throws IOException, MessagingException {        headers.writeTo(out, null);        // add the separater between the headers and the data portion.        out.write('\r');        out.write('\n');        // we need to process this using the transfer encoding type        getDataHandler().writeTo(MimeUtility.encode(out, getEncoding()));    }