Implement IO.read :rw as specced