Implementation of InputStream and OutputStream with enabled on-fly logging.