How to convert a doc stream into pdf stream using LO API


I have requirement where I am getting document stream and I want to convert the doc and get the PDF stream back. I found one solution where I can read the doc steam and convert it into ByteArray stream . This stream is then passed into convertor to get the pdf.
This solution is not good because I cannot read entire stream and keep it in memory (this could be problem if the doc is big) . So, I am looking for a solution where I can provide the doc stream and get pdf as stream.

Thanks in advance.

For now i think that there is no solution with LO API.