Passing I/O functions to a class.

Oh, thanks. This looks like a starting point.
I think I had tried a very similar example.

I must read up about streams, never really used them.
How do I call that for tests on a Linux text console (not Arduino)?