Adds byte counter in input and output stream classes.