Al posto del FileOutputStream, usa un ByteArrayOutputStream.
Poi usi tale oggetto per ottenere la stringa.


Ciao.