Save existing filesystem file into AttachmentInstance Bonita type inside connector.

Hi all,
I’m using Bonita 5.10.2. I’m developing a Java connector wich output is of type Attachment. I’m then saving this output inside one of my Attachment type variable in the process. I already have the file stored in my disk, what I need to know is: how do I convert this file in an AttachmentInstance inside my connector?
Wath Java code do i need? It sholud be something that convert a ByteArray to an AttachmentInstance.

Thanks a lot!