How could I possibly make that this stream is written to a file? I daresay there is no way to do that.
However, since the OutputStream is used to write bytes, you can write those same bytes in a FileOutputStream after or before you have writen them into the returned OutputStream. In other words, you write your bytes in both streams.
Does that help?
subject: how to write the bytes in OutputStream to file?