rewritten erroneous code for reading/writing strings as Raptor iostreams