Using JavaSDK, Is it possible to create a FITFile entirely in memory, not relying on a File?

I am developing an application that requires direct access to the bytes of a FitFile without writing to disk. Currently, the only API I have found is FileEncoder, which seems to lack the functionality for handling an OutputStream directly. Is there an alternative API that can accept an OutputStream, or perhaps a method to modify the FileEncoder usage to meet this requirement?