allow usage of particular output stream

In applications that provide results on stdout, it is necessary to allow writing to an alternative output stream. This allows that functionality.