fix issue 2686: clear buffer at the end of reading instead of assigning to None, in case object is reused