Adding support for read_input, read_output and write_output, which all read/write all at once.