Improving I/O streams interfaces.

Signed-off-by: Frank Mertens <frank@cyblogic.de>