Hi Venkat,
Depending on your use case you might not need an additional java action. Take a look at the popular Community Commons module which contains a StringFromFile action, as well as many other useful file utilities. At the very least it should help you on your quest to get the InputStream from a a file.
Or try:
Core.getFileDocumentContent(getContext(), this.<fileDocumentObject>)
fileDocumentObject must implement system.FileDocument.
You can do this with native Mendix. Get the html from the filedocemt with StringFromFile. Put the result in an attribute. Create a simple documenttemplate with one attribute of type XHTML. Create the document.