Rewind the string io if needed