vaadin touchkit and opening files

I am working on a vaaidn touchkit application I should be able to view any type of document.

I have already got the inpustream from a rest api.
InputStream is = response.getEntity().getContent();

How can the data be converted to a pdf format then allow the user to open it in the browser?