Ability to get size of data wasn't processed.

Also added code for holding referencies and shared pointers to channel in Istream an OStream.