docs: public static PreparedAttachment prepareAttachment(String attachmentsDir,
                                                            AttachmentStreamFactory attachmentStreamFactory,
                                                            Attachment attachment)
              throws AttachmentException {
          if (attachment.encoding != Attachment.Encoding.Plain) {
              throw new AttachmentNotSavedException("Encoded attachments can only be prepared if the value of \"length\" is known");
          }
          return new PreparedAttachment(attachment, attachmentsDir, 0, attachmentStreamFactory);
      }