code: public void setContent(Content content) {
          setSize(content.getContent().length);
          setAttachmentContentId(content.getId());
      }
docs: Sets the content for this attachment, i.e. the <field>size</field> and the <field>attachmentContentId</field>.
  @param content attachment content