protected BodyPart handleImageBinaryPart(MimePart image, String contentType) throws IOException, MessagingException {
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        FileCopyUtils.copy(image.getInputStream(), bos);
        String base64 = Base64.encodeBase64String(bos.toByteArray());
        return new BodyPart(base64, contentType);
    }
protected BodyPart handleImageBinaryPart ( MimePart image , String contentType ) throws IOException , MessagingException { ByteArrayOutputStream bos = new ByteArrayOutputStream ( ) ; FileCopyUtils . copy ( image . getInputStream ( ) , bos ) ; String base64 = Base64 . encodeBase64String ( bos . toByteArray ( ) ) ; return new BodyPart ( base64 , contentType ) ; }
Construct base64 body part from image data.
@param image
@param contentType
@return
@throws IOException