moved some extensions into IOStreamExtensions