readbuffer now only referenced inside indata
combine begin/remaining parts of file loop