io handler written.  allows buffered and non-buffered input