General purpose io.Reader / io.Writer utility functions.